Skip to content

Preserve projection metadata and dialect-aware CREATE parsing - #46

Merged
osipovartem merged 4 commits into
embucket-sync-df55.0.0from
fix-df55-snowflake-create-dialect
Aug 31, 2026
Merged

Preserve projection metadata and dialect-aware CREATE parsing#46
osipovartem merged 4 commits into
embucket-sync-df55.0.0from
fix-df55-snowflake-create-dialect

Conversation

@osipovartem

@osipovartem osipovartem commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • delegate non-DataFusion CREATE statements back through the configured SQL dialect, restoring Snowflake CREATE ICEBERG TABLE, CREATE STAGE, and fork-provided CREATE EXTERNAL VOLUME parsing used by Rustice
  • reserve DataFusion's CREATE EXTERNAL TABLE parser only for an actual [TEMPORARY] TABLE prefix
  • preserve metadata-changing projections when projection pushdown rewrites unions, filters, cross joins, hash joins, and sort-merge joins
  • preserve outer field metadata for direct-column projection chains while continuing to derive metadata for computed expressions such as Arrow extension-type casts
  • align inherited unit, SQL logic, and TPCH expectations with the fork's Snowflake half-away-from-zero decimal semantics and named UDTF arguments
  • fix the hash-join spill rustdoc link under RUSTDOCFLAGS=-D warnings
  • keep grace hash-join spill partition routing independent from intentional force_hash_collisions, while preserving collision coverage inside each partition's hash table

This prevents DataFusion 55's physical ProjectionPushdown optimizer from restoring source PARQUET:field_id metadata that a logical projection intentionally removed, while avoiding the opposite regression where native extension metadata was lost.

DataFusion 50/53 port audit

The three Embucket commits on DF50 were carried into the DF53 fork lineage; both histories were checked before classifying the items below.

Retained on DF55:

  • Snowflake SQL extensions, PIVOT/UNPIVOT lowering, named table-function arguments, and the planner APIs used by Rustice
  • decimal division and AVG half-away-from-zero semantics
  • hash-join spilling
  • Embucket SQLParser features through the Rustice [patch.crates-io] pin, including EXTERNAL VOLUME, standalone BEGIN, SHOW VARIABLES, timestamp precision, partitioning, and Snowflake string escapes

Superseded or owned elsewhere:

  • the old logical/protobuf Pivot node is replaced by DF55 lowering to standard aggregate/union plans
  • the old subquery/CSE patches are superseded by DF55's redesigned decorrelation path
  • timestamp TO_DATE coercion is upstream in DF55
  • REGEXP_SUBSTR is implemented and tested in Rustice

Not blindly ported:

  • the untested df53 boolean-vs-integer comparison coercion and permissive non-string || coercion
  • public visibility changes for APIs no longer used by Rustice

Those coercions broaden upstream behavior and should only return behind Snowflake differential correctness tests.

Verification

  • cargo +1.97.0 fmt --all -- --check
  • cargo +1.97.0 test -p datafusion-sql (91 unit, 572 integration, 12 doctests passed; 1 doctest ignored)
  • cargo +1.97.0 clippy -p datafusion-sql --all-targets -- -D warnings
  • cargo +1.97.0 test -p datafusion-physical-expr --lib (1,586 passed; 2 ignored)
  • RUSTDOCFLAGS='-D warnings' cargo +1.97.0 doc --document-private-items --no-deps --workspace
  • all six previously failing collision-mode spill regressions pass locally, including all join types, NULL equality, recursive repartitioning, and CollectLeft
  • cargo +1.97.0 clippy -p datafusion-common -p datafusion-physical-plan --lib --features datafusion-physical-plan/force_hash_collisions,datafusion-common/force_hash_collisions -- -D warnings
  • focused decimal division/AVG, hash-join spill, PIVOT/UNPIVOT, named UDTF, projection metadata, and SQL logic regressions
  • Rustice cargo +1.97.0 test -p executor --lib --locked (436 passed; 7 intentionally ignored), including fork-backed CREATE EXTERNAL VOLUME parsing

Required by Embucket/rustice#59.

@osipovartem
osipovartem force-pushed the fix-df55-snowflake-create-dialect branch 3 times, most recently from b1657a1 to 0a8252c Compare August 30, 2026 20:24
@osipovartem
osipovartem force-pushed the fix-df55-snowflake-create-dialect branch from 0a8252c to 549b436 Compare August 30, 2026 20:36
@osipovartem osipovartem changed the title Restore dialect-aware CREATE parsing on DataFusion 55 Preserve projection metadata and dialect-aware CREATE parsing Aug 30, 2026
@osipovartem
osipovartem requested review from Vedin and camuel and removed request for camuel August 30, 2026 23:49
@osipovartem
osipovartem merged commit c5ed78b into embucket-sync-df55.0.0 Aug 31, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant