Skip to content

Comments

[CALCITE-5523] RelToSql converter generates GROUP BY clause with wind…#3431

Open
JiajunBernoulli wants to merge 1 commit intoapache:mainfrom
JiajunBernoulli:CALCITE-5523
Open

[CALCITE-5523] RelToSql converter generates GROUP BY clause with wind…#3431
JiajunBernoulli wants to merge 1 commit intoapache:mainfrom
JiajunBernoulli:CALCITE-5523

Conversation

@JiajunBernoulli
Copy link
Contributor

…ow expression

return true;
}
if (!dialect.supportsNestedAggregations()
&& agg.getInput() instanceof Project
Copy link
Contributor

Choose a reason for hiding this comment

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

What if input is Window object?

Copy link
Contributor

Choose a reason for hiding this comment

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

And also agg.getInput() could be a Calc as well.

IMO something is deeply wrong with needNewSubQuery in general in terms of that it uses instanceof Project in multiple places, but does not really care about having Calc or Window on the same position, instead.

One of the possible solutions that could make whole code of RelToSqlConverter simpler, is to do some "normalization" of relational tree inside SqlImplementor::visitRoot(...) method in order to transform it to a form having less possible amount of node types.

But I guess that is something that needs to be discussed on the mailing list.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When will the input of Aggreagte be Window?

Window only appear when you use ProjectToWindowRule and I think the window will not be input of Aggregate.

Copy link
Contributor

Choose a reason for hiding this comment

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

@JiajunBernoulli

It looks that you are right, at least I cannot reproduce an issue with Window under Aggregate that would also have a problem of aggregation by window expression.

But I guess that part of my comment about Calc is still relevant.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@LakeShen
Copy link
Contributor

LakeShen commented Oct 4, 2023

Hi @JiajunBernoulli

It looks like the title and commit's description is not clear.

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 28, 2025
@github-actions github-actions bot removed the stale label Sep 7, 2025
@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 26, 2025
@github-actions github-actions bot removed the stale label Jan 13, 2026
@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants