Skip to content

Resolve Snowflake WHERE aliases with input-column precedence - #164

Merged
osipovartem merged 1 commit into
df55-physical-udf-instancefrom
df55-where-alias-precedence
Oct 23, 2026
Merged

osipovartem merged 1 commit into
df55-physical-udf-instancefrom
df55-where-alias-precedence

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve Snowflake WHERE references against input columns before SELECT aliases, including quoted names and correlated subqueries.
  • Preserve lambda scoping with capture-avoiding parameter renaming and bound recursive alias expansion by reference and AST-node budgets.
  • Keep the behavior gated to the Snowflake SQL dialect; other dialects retain their current planner path.

Validation

  • Snowflake live probes confirmed input-column precedence, inner-alias precedence over outer columns, and lambda capture behavior.
  • datafusion-sql integration: 655 passed.
  • cargo fmt --all --check passed.
  • cargo clippy -p datafusion-sql --tests passed with the pre-existing datafusion-expr nonminimal_bool lint allowed.
  • Independent read-only review approved the final diff.

Rustice will remove its schema-blind WHERE AST rewrite and pin this revision.

@github-actions github-actions Bot added the sql label Oct 23, 2026
@osipovartem
osipovartem merged commit 432ee5f into df55-physical-udf-instance Oct 23, 2026
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant