Repository navigation
fix(flight): announce the streamed type for round() on decimals - #15656
Merged
phillipleblanc merged 3 commits intoOct 27, 2026
Merged
Conversation
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
Contributor
✅ Pull with Spice PassedPassing checks:
|
Contributor
There was a problem hiding this comment.
🟡 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
phillipleblanc
enabled auto-merge
October 27, 2026 10:23
ewgenius
approved these changes
Oct 27, 2026
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHAT
Flight SQL clients such as ADBC can run
round()on decimals again, for exampleSELECT round(CAST(2.345 AS DECIMAL(10,3)), 2)orround(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 sentdecimal(10,2), so ADBC failed with "endpoint 0 returned inconsistent schema".HOW
CAST(Int64(2) AS Int32), soroundcould not see the literal and planneddecimal(p+1,s). The simplifier later folded the cast, androundre-typed the result todecimal(p,2). The optimizer's schema check ignores decimal precision and scale, so the change went unnoticed.decimal(p, decimal_places), which is what HTTP already returns. A regression test checks that the announced and streamed types agree for a literal, a column andavg.