-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CALCITE-6321] Add copy(List<RexLiteral>) method to Window class #3736
Conversation
* @param constants List of constants that are additional inputs | ||
* @return New {@code Window} | ||
*/ | ||
public abstract Window copy(List<RexLiteral> constants); |
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 would actually call this method withConstants, in line with other naming conventions in Calcite.
I find the JavaDoc confusing, because these are not additional inputs, these replace the existing constants of the window.
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 agree with the confusing javadoc.
I have no strong opinion on the method name, but I have the impression that, in terms of RelNode "operators", in other similar cases we have named them copy
.
Independently of the name, we could consider this a "breaking change" (any downstream project extending Window will be "broken" on the next Calcite upgrade, and will require a minor adjustment to provide the implementation of this new abstract method). So I'd propose to add the corresponding comment in history.md
(in the commented out "breaking changes" section for next release).
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 can rename this, but copy
is also used like this in other classes.
https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/core/Filter.java#L125
https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java#L148
Should I still rename this method?
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.
if that's the convention you can keep it this way.
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've updated the Javadoc comment to better describe how constants
is used.
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've added a comment to the API changes for 1.37.0 in the history.md
file.
a0fb49e
to
f13484c
Compare
site/_docs/history.md
Outdated
@@ -57,6 +57,9 @@ other software versions as specified in gradle.properties. | |||
#### Bug-fixes, API changes and minor enhancements | |||
{: #fixes-1-37-0} | |||
|
|||
* [<a href="https://issues.apache.org/jira/browse/CALCITE-6321">CALCITE-6321</a>] | |||
Add `copy(List<RexLiteral>)` method to `Window` class |
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.
IMO, it would be better to move this into the "Breaking Changes" section, and add a bit more info about the impact, e.g.: "any subclass of Window
will need to implement this new method".
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.
That makes sense. I have moved this into the breaking changes section.
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.
The code looks fine.
Is there any existing part of Calcite that benefits from this additional capability that could be highlighted in a test?
@rubenada suggested a change for the history file, once that is done this can be merged from my pov.
f13484c
to
5450c75
Compare
I see that the branch has conflicts, probably due to me merging a PR just a few minutes ago. |
5450c75
to
d90ab36
Compare
@mihaibudiu I have rebased and fixed the conflict. |
Quality Gate passedIssues Measures |
No description provided.