Extend expression planners for Snowflake compatibility - #47
Open
osipovartem wants to merge 14 commits into
Open
Conversation
Expose input schema to scalar expression planners
Plan qualified wildcard options in function arguments
…nto snowflake-decimal-literals
Add optional decimal literal normalization
Fix wildcard keys for USING outer joins
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
SqlToRelalias.* EXCLUDE (...)datafusion.sql_parser.trim_decimal_literal_trailing_zerossetting for Snowflake-compatible exact decimal inferenceh2to 0.4.16 to addressRUSTSEC-2026-0258This is the collapsed DataFusion side of the Rustice Snowflake compatibility stack. It includes the work previously reviewed independently in #48, #49, and #50.
Compatibility
All new behavior is opt-in through custom expression planners or the new configuration setting. Default DataFusion parsing, type inference, and expression planning remain unchanged.
The hooks allow Rustice to implement schema-dependent Snowflake syntax including qualified wildcard expansion in aggregate and scalar functions. Decimal normalization reproduces Snowflake inference such as:
10.00 -> DECIMAL(2, 0)10.10 -> DECIMAL(3, 1)0.00100 -> DECIMAL(4, 3)1.2300e2 -> DECIMAL(3, 0)Validation
cargo check -p datafusiondatafusion-common,datafusion-expr,datafusion-sql, anddatafusionwith-D warningscargo fmt --all -- --check