Skip to content

Conversation

lincoln-lil
Copy link
Contributor

This is a backport pr for release-2.1 branch.

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 26, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@snuyanzin
Copy link
Contributor

@lincoln-lil it seems you can not just cherry-pick it since in master there is Calcite 1.36 and in 2.1 Calcite 1.34, AggregateReduceFunctionsRule.java should be adapted accordingly

@lincoln-lil
Copy link
Contributor Author

@snuyanzin Thank you for helping this! Since it's just a backport and we won't bump up calcite version for release-2.1, we can simply squash the commits into a single commit, WDYT?
Or do you see the needs that we should keep 2 commits as the master branch does? If so, I'll reorg the commits.

@snuyanzin
Copy link
Contributor

can simply squash the commits into a single commit, WDYT

yes, +1 for squashing, however I usually do this after approvals

* to simpler forms. This rule is copied to fix the correctness issue in Flink before upgrading to
* the corresponding Calcite version. Flink modifications:
*
* <p>Lines 555 ~ 565 to fix CALCITE-7192.
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 checked this file locally with a reformatted one from calcite-1.34.0, all the delta changes looks correct.

@lincoln-lil
Copy link
Contributor Author

can simply squash the commits into a single commit, WDYT

yes, +1 for squashing, however I usually do this after approvals

Sure, I'll ask someone help the review first.

Copy link
Contributor

@dylanhz dylanhz left a comment

Choose a reason for hiding this comment

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

LGTM overall, just one minor suggestion.

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/** Test for {@link AggregateReduceFunctionsRule}. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Import this rule.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the tips! But I can’t find a strict rule that requires adding import statements for classes referenced only in comments, just to avoid red underlines in certain IDEs. Moreover, in the existing *RuleTest classes, we’ve consistently followed the convention of not adding such imports (see flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/rules/logical/*RuleTest.java).
Besides that, there’s nothing else that needs to be changed so far, so I’m planning not to make this modification. Does that sound okay to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the feedback, no more comments from me.
Still, I’d prefer fully qualified names in this case.

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 checked the existing RuleTest classes — they don’t need explicit imports because they share the same package as the Flink extended rules, so the IDE doesn’t flag any errors.
In this case, however, the packages are different, so I’ll follow your suggestion and make the change.

@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Oct 9, 2025
@lincoln-lil
Copy link
Contributor Author

@flinkbot run azure

@snuyanzin
Copy link
Contributor

@lincoln-lil fyi: rerun will not help here
need to wait for #27097 to be merged and then rebase

@lincoln-lil lincoln-lil merged commit 1c44b5a into apache:release-2.1 Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community. target:release-2.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants