Skip to content

fix(flight): announce the streamed type for round() on decimals - #15656

Merged
phillipleblanc merged 3 commits into
trunkfrom
phillip/261027-decimal-round-flight-schema
Oct 27, 2026
Merged

phillipleblanc merged 3 commits into
trunkfrom
phillip/261027-decimal-round-flight-schema

Conversation

@phillipleblanc

Copy link
Copy Markdown
Contributor

WHAT

Flight SQL clients such as ADBC can run round() on decimals again, for example SELECT round(CAST(2.345 AS DECIMAL(10,3)), 2) or round(avg(price), 2). GetFlightInfo now announces the same type that DoGet streams (decimal(10,2) in the example). Fixes #15652.

WHY

GetFlightInfo announced decimal(11,3) but the stream sent decimal(10,2), so ADBC failed with "endpoint 0 returned inconsistent schema".

HOW

Pin spiceai/datafusion#273, which backports apache/datafusion#23232.
Type coercion now turns an implicit cast of a scalar-function literal
into a literal of the coerced type. round(decimal, 2) therefore plans the
same result type after analysis (the schema Flight SQL GetFlightInfo
announces) as after optimization (the type the stream sends).

Fixes #15652
@phillipleblanc
phillipleblanc requested a review from a team as a code owner October 27, 2026 05:06
Copilot AI balanced review requested due to automatic review settings October 27, 2026 05:06
@github-actions github-actions Bot added area/config kind/bug Something isn't working kind/dependencies Pull requests that update a dependency file labels Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Pull with Spice Passed

Passing checks:

  • ✅ Title meets minimum length requirement (10 characters)
  • ✅ No banned labels detected
  • ✅ Has a label from required category kind/
  • ✅ Has a label from required category area/
  • ✅ Has at least one assignee: phillipleblanc

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unchanged fork-patch ledger causes the required lint gate’s drift check to reject the DataFusion pin update.

1 open issue
What changed in this PR

This PR addresses #15652 by aligning the decimal type announced to Flight SQL clients with the type streamed for round() queries.

Changes:

  • Updates the DataFusion fork pin to include the literal-coercion backport.
  • Adds schema-consistency regression coverage for decimal literals, columns, and avg() results.
File Description
crates/​runtime/​src/​datafusion/​query.rs Adds decimal-round schema consistency tests.
Cargo.toml Updates DataFusion dependencies to the backported revision.
Cargo.lock Locks DataFusion packages to the new revision.

Review effort: Balanced

Comment thread Cargo.toml Resolved
Copilot AI balanced review requested due to automatic review settings October 27, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The backport affects shared scalar-function coercion and needs human review supported by runtime and Flight-client validation unavailable here.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@phillipleblanc phillipleblanc self-assigned this Oct 27, 2026
Copilot AI balanced review requested due to automatic review settings October 27, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The backport affects shared scalar-function coercion and needs human sign-off supported by runtime and end-to-end Flight SQL validation unavailable in this review.

No open issues 🎉

Review effort: Balanced

@phillipleblanc
phillipleblanc added this pull request to the merge queue Oct 27, 2026
Merged via the queue into trunk with commit 814e639 Oct 27, 2026
69 of 70 checks passed
@phillipleblanc
phillipleblanc deleted the phillip/261027-decimal-round-flight-schema branch October 27, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config area/docs kind/bug Something isn't working kind/dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

round() on decimals fails over Flight SQL: GetFlightInfo schema differs from the stream (2.4.0 regression)

3 participants