Fall back to floats for out-of-range decimal literals - #55
Merged
osipovartem merged 1 commit intoSep 2, 2026
Merged
Conversation
osipovartem
merged commit Sep 2, 2026
e017e21
into
expr-planner-aggregate-schema
47 of 51 checks passed
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.
Summary
parse_float_as_decimalis enabledFloat64when a fractional or scientific literal exceeds Arrow Decimal precision/scale limitsMotivation
Snowflake accepts values such as
1.7976931348623157e+308and2.2250738585072014e-308as DOUBLE. With decimal-literal parsing enabled, DataFusion previously rejected them before target-type coercion because their Decimal scale or precision cannot be represented by Arrow.This prevented otherwise valid inserts into FLOAT columns. The fallback is limited to syntax that already denotes a fractional/scientific numeric value and only runs after Decimal planning reports an unsupported representation.
Validation
cargo +1.97.0 test -p datafusion-sql --test sql_integration parse_decimalcargo +1.97.0 test -p datafusion-sql test_parse_decimalcargo +1.97.0 clippy -p datafusion-sql --all-targets -- -D warningscargo +1.97.0 fmt --all --checkdata-types/float.slt: 18/19 -> 19/19