Skip to content

Plan nested LAG and LEAD for Snowflake conditional events - #70

Merged
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
snowflake-conditional-event-nested-rank
Sep 6, 2026
Merged

Plan nested LAG and LEAD for Snowflake conditional events#70
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
snowflake-conditional-event-nested-rank

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • stage nested window planning only for Snowflake CONDITIONAL_TRUE_EVENT
  • allow nested LAG/LEAD only when partition and ordering match the outer window
  • keep ordinary nested windows and mismatched conditional-event windows rejected

Why

Snowflake documents LAG and LEAD as supported inside the condition of CONDITIONAL_TRUE_EVENT. The general nested-window exception was previously too broad; this restores only the documented case.

Validation

  • cargo +1.97.0 test -p datafusion-sql --lib --tests (92 unit + 588 integration tests passed)
  • cargo +1.97.0 clippy -p datafusion-sql --all-targets -- -D warnings
  • cargo +1.97.0 fmt --all -- --check

@osipovartem
osipovartem merged commit 4d63dc7 into embucket-sync-df55.0.0 Sep 6, 2026
19 checks passed
@github-actions github-actions Bot added the sql label Sep 6, 2026
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