Skip to content

[CALCITE-7479] Remove redundant aggregate group keys with FD#4892

Draft
xiedeyantu wants to merge 2 commits intoapache:mainfrom
xiedeyantu:agg-remove
Draft

[CALCITE-7479] Remove redundant aggregate group keys with FD#4892
xiedeyantu wants to merge 2 commits intoapache:mainfrom
xiedeyantu:agg-remove

Conversation

@xiedeyantu
Copy link
Copy Markdown
Member

@xiedeyantu xiedeyantu commented Apr 18, 2026

Jira Link

CALCITE-7479

Changes Proposed

@xiedeyantu xiedeyantu marked this pull request as draft April 18, 2026 16:08
@xiedeyantu
Copy link
Copy Markdown
Member Author

Just draft.

@xiedeyantu xiedeyantu force-pushed the agg-remove branch 2 times, most recently from e303afb to 137af74 Compare April 19, 2026 01:33
@xiedeyantu xiedeyantu changed the title [CALCITE-0000] Remove redundant aggregate group keys with FD [CALCITE-7479] Remove redundant aggregate group keys with FD Apr 19, 2026
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
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.

This looks fine.
How come it is never applicable?
Are all our tests using optimal group by keys?
Or we just don't have many tables with keys?

@xiedeyantu
Copy link
Copy Markdown
Member Author

This looks fine. How come it is never applicable? Are all our tests using optimal group by keys? Or we just don't have many tables with keys?

"How come it is never applicable?" I didn't quite understand the meaning of this sentence. Because the functional dependencies we currently support are limited, I used the primary key as an example.

@mihaibudiu
Copy link
Copy Markdown
Contributor

No other tests were modified

@xiedeyantu
Copy link
Copy Markdown
Member Author

I'm concerned about whether this rewrite is meaningful, as it requires the introduction of
"single_value".

@mihaibudiu
Copy link
Copy Markdown
Contributor

I think there are other uses of SINGLE_VALUE in the compiler.

@xiedeyantu
Copy link
Copy Markdown
Member Author

No other tests were modified

Because this new rule is not set as a "default" rule, it doesn't have any other impact.

@mihaibudiu
Copy link
Copy Markdown
Contributor

Can you make it default and see what happens?

@xiedeyantu
Copy link
Copy Markdown
Member Author

I think there are other uses of SINGLE_VALUE in the compiler.

Are you suggesting that I don't need to worry too much about "single_value"? Can the compiler do more?

@xiedeyantu
Copy link
Copy Markdown
Member Author

Can you make it default and see what happens?

Of course, I can create a new branch to add it as a default rule and observe the outcome later.

@mihaibudiu
Copy link
Copy Markdown
Contributor

Doesn't even have to be a branch, you can run the experiment and report the results.

@mihaibudiu
Copy link
Copy Markdown
Contributor

There are lots of uses of SINGLE_VALUE, I think that one is fine.
I am more worried about whether the functional dependency is sufficiently conservative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants