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: add more window functions #534

Merged
merged 15 commits into from
Sep 8, 2023

Conversation

richtia
Copy link
Member

@richtia richtia commented Aug 1, 2023

PR to add more window functions:

  • first_value
  • last_value
  • nth_value
  • lead
  • lag

extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
@richtia richtia force-pushed the additional_window_functions branch from c9d1f27 to f0721e7 Compare August 1, 2023 18:31
@richtia richtia requested a review from EpsilonPrime August 1, 2023 22:27
EpsilonPrime
EpsilonPrime previously approved these changes Aug 1, 2023
Copy link
Contributor

@jacques-n jacques-n left a comment

Choose a reason for hiding this comment

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

mostly looks good but a couple of return types seem weird.

extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
@richtia richtia requested a review from jacques-n August 2, 2023 16:09
Copy link
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

I have a few requests. Also, I'm not sure we need to say things like "expression is evaluated against". We don't really use that terminology elsewhere. For example, we could phrase addition as:

Two different expressions are evaluated. The results of these expressions are added together.

But I think that is more confusing. In other words, I think:

Returns the first value in the window

is more clear than:

The expression is evaluated against the first row.

extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
@richtia richtia requested a review from westonpace August 3, 2023 16:45
Copy link
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

A few more nitpicks

extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
@EpsilonPrime
Copy link
Member

Looks like there's one failing check to address before we can proceed here.

@richtia
Copy link
Member Author

richtia commented Aug 11, 2023

Looks like there's one failing check to address before we can proceed here.

Thanks! Had a typo!

EpsilonPrime
EpsilonPrime previously approved these changes Aug 11, 2023
@EpsilonPrime
Copy link
Member

@westonpace Anything else you'd like to see?

westonpace
westonpace previously approved these changes Sep 8, 2023
Copy link
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

The return of first_value and last_value is only nullable if the input is nullable. I don't remember if we have syntax for that or not. But this is minor and we can always adjust later if needed.

extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
extensions/functions_arithmetic.yaml Outdated Show resolved Hide resolved
@richtia richtia dismissed stale reviews from westonpace and EpsilonPrime via 72cf04b September 8, 2023 17:30
@richtia richtia merged commit f2bfe15 into substrait-io:main Sep 8, 2023
12 checks passed
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.

4 participants