Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(snowflake): FINAL/RUNNING keywords in MATCH_RECOGNIZE MEASURES #3284

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

VaggelisD
Copy link
Collaborator

Fixes #3282

The MEASURES subclause now supports the following syntax:

MEASURES  {FINAL | RUNNING} <expr> AS <alias> [, ... ]* 

Where each individual subclause is stored in a new expression exp.MatchRecognizeMeasure

Docs

Copy link
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions to refactor this. Looks good. Curious if the FINAL / RUNNING keywords are also supported by other dialects that have MATCH_RECOGNIZE (e.g. Oracle?)

sqlglot/parser.py Outdated Show resolved Hide resolved
tests/dialects/test_snowflake.py Outdated Show resolved Hide resolved
sqlglot/expressions.py Outdated Show resolved Hide resolved
sqlglot/parser.py Outdated Show resolved Hide resolved
VaggelisD and others added 2 commits April 8, 2024 19:04
Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
@georgesittas georgesittas merged commit 0690cbc into main Apr 8, 2024
5 checks passed
@georgesittas georgesittas deleted the vaggelisd/match_recognize branch April 8, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support FINAL/RUNNING specifier for measures in match_recognize (Snowflake)
3 participants