Skip to content

Preserve Snowflake PIVOT column names - #56

Merged
osipovartem merged 2 commits into
expr-planner-aggregate-schemafrom
snowflake-pivot-column-names
Sep 3, 2026
Merged

Preserve Snowflake PIVOT column names#56
osipovartem merged 2 commits into
expr-planner-aggregate-schemafrom
snowflake-pivot-column-names

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • preserve the SQL literal text, including string quotes, in generated PIVOT column names
  • honor explicit PIVOT value aliases and normal identifier normalization
  • use the resolved name consistently in the aggregate and DEFAULT ON NULL projection

Snowflake names a column generated from IN ('2023_Q1') as '2023_Q1', so it is addressed as "'2023_Q1'". The previous planner stripped the single quotes and produced 2023_Q1.

Validation

  • live Snowflake oracle query confirmed the '2023_Q1' output name and explicit alias behavior
  • cargo +1.94.0 test -p datafusion-sql --offline - 92 unit tests, 582 integration tests, and 12 doctests passed (1 doctest ignored)
  • cargo +1.94.0 clippy -p datafusion-sql --all-targets --offline -- -D warnings
  • cargo +1.94.0 fmt --all -- --check
  • git diff --check

Dependency

This PR is based on #47, which consolidates the existing DF55 compatibility commits into embucket-sync-df55.0.0. After #47 merges, this PR can be retargeted to that branch without carrying unrelated changes.

@github-actions github-actions Bot added the sql label Sep 3, 2026
@github-actions github-actions Bot added the core label Sep 3, 2026
@osipovartem
osipovartem merged commit 3f2da7b into expr-planner-aggregate-schema Sep 3, 2026
69 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