-
Notifications
You must be signed in to change notification settings - Fork 156
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 windowrel support in proto #399
Conversation
@jacques-n Please help to review if you have available time. Thanks for your help! |
10c8823
to
c59b70f
Compare
proto/substrait/algebra.proto
Outdated
WINDOW_TYPE_ROWS = 1; | ||
WINDOW_TYPE_RANGE = 2; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small suggestion. I think using window frame
is more proper and more clear to user than using window type
. Right?
enum WindowFrame {
WINDOW_FRAME_UNSPECIFIED = 0;
WINDOW_FRAME_ROWS = 1;
WINDOW_FRAME_RANGE = 2;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you suggestion. And very sorry that I did not reply in time. I have already changed to WindowFrame.
c59b70f
to
2f91df7
Compare
ACTION NEEDED Substrait follows the Conventional Commits specification for release automation. The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. |
3600c8a
to
343bf7b
Compare
@jacques-n Can you help to review again? |
343bf7b
to
08acfae
Compare
There was a problem hiding this 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 questions but this seems like a good start.
f5acd5e
to
5e24a88
Compare
@westonpace @cpcloud Can you help to review again? Thanks for your help! |
@JkSelf thanks for the update. Based on previous discussion I think this is a physical counterpart to WindowFunction. In other words: A logical plan will only need If you agree I think we should make a few changes:
|
@westonpace Thanks for your reply.
Yes. We can define a
The difference between
If we use |
I think this redundancy is expected when we have logical and physical operators. For example, the physical
No, because the logical representation needs to be able to stand alone. It should be legal to have a "purely logical plan" that has
Yes. Also, streaming could make sense if the data was also sorted by the partition field.
Ok, then I think we need to add a new relation to
|
Ok, I agree this should support both. However, the output of an aggregate window function is scalar. In other words: Given |
Yes. the |
@westonpace Thanks for your detailed explanation. I will define a new function without sort to replace the Window function. And also update the |
@westonpace is this ok to merge? |
5e24a88
to
53eeed6
Compare
@westonpace Can you help to review again? Thanks for your help. |
I'm fine with not implementing this for now. |
Per discussion in the sync this morning, @westonpace and I have merged in main and applied some small changes to move this along. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structurally I think we've reached the correct point for this PR. I have some minor suggestions regarding how we document this. We recently updated (or are updating) the wording of WindowFunction.function_reference
to state that we allow both window and aggregate functions. However, that change is not mirrored here.
Rather than try and keep the comments in sync between the two definitions I think we should only have one set of definitions and only document the parts that are different here.
I'm marking this as approved because this PR has been around for a while. If these changes are not addressed then I propose we merge it as is and clean up the docs in a follow-up PR.
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
Co-authored-by: Weston Pace <[email protected]>
@vbarua @westonpace @jacques-n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.