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

[CALCITE-6321] Add copy(List<RexLiteral>) method to Window class #3736

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

normanj-bitquill
Copy link
Contributor

No description provided.

* @param constants List of constants that are additional inputs
* @return New {@code Window}
*/
public abstract Window copy(List<RexLiteral> constants);
Copy link
Contributor

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.

Copy link
Contributor

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@normanj-bitquill normanj-bitquill force-pushed the calcite-6321 branch 2 times, most recently from a0fb49e to f13484c Compare March 19, 2024 17:40
@@ -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
Copy link
Contributor

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".

Copy link
Contributor Author

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.

Copy link
Contributor

@mihaibudiu mihaibudiu left a 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.

@mihaibudiu
Copy link
Contributor

I see that the branch has conflicts, probably due to me merging a PR just a few minutes ago.
Can you please rebase again on main?

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Apr 1, 2024
@normanj-bitquill
Copy link
Contributor Author

@mihaibudiu I have rebased and fixed the conflict.

Copy link

sonarcloud bot commented Apr 1, 2024

@mihaibudiu mihaibudiu merged commit f948850 into apache:main Apr 1, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM-will-merge-soon Overall PR looks OK. Only minor things left.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants