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

Cleanup AggreggationNode#producesDistinctRows #23806

Merged

Conversation

pettyjamesm
Copy link
Member

Description

Adds missing comment and check for the grouping count set as a follow up from #23776

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@pettyjamesm pettyjamesm requested a review from sopel39 October 16, 2024 16:52
@cla-bot cla-bot bot added the cla-signed label Oct 16, 2024
@@ -232,7 +232,8 @@ public boolean producesDistinctRows()
{
return aggregations.isEmpty() &&
!groupingSets.getGroupingKeys().isEmpty() &&
outputs.size() == groupingSets.getGroupingKeys().size();
groupingSets.getGroupingSetCount() == 1 &&
Copy link
Member

Choose a reason for hiding this comment

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

nit: consider adding comment why we need to check groupingSets.getGroupingSetCount() == 1

@@ -232,7 +232,8 @@ public boolean producesDistinctRows()
{
return aggregations.isEmpty() &&
!groupingSets.getGroupingKeys().isEmpty() &&
outputs.size() == groupingSets.getGroupingKeys().size();
groupingSets.getGroupingSetCount() == 1 &&
outputs.size() == groupingSets.getGroupingKeys().size(); // grouping keys are always added to the outputs list, so a size match guarantees the two contain the same elements
Copy link
Member

Choose a reason for hiding this comment

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

note that this check is too strict when hash symbol is present. In most cases you don't really care about hash symbol being distinct. It's not a bit issue now that hash is off by default

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point- although that’s already been the case before your change, so not something I’ll worry about fixing here.

@pettyjamesm pettyjamesm merged commit fae6603 into trinodb:master Oct 18, 2024
93 checks passed
@pettyjamesm pettyjamesm deleted the cleanup-aggregationnode-check branch October 18, 2024 18:06
@github-actions github-actions bot added this to the 463 milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants