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

[fix](agg)disallow group by bitmap or hll data type #11782

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

starocean999
Copy link
Contributor

@starocean999 starocean999 commented Aug 15, 2022

Proposed changes

disallow "select distinct bitmap, hll from xxx", because in some case, the FE will introduce a agg node with group by bitmap or hll exprs to implement the "distinct" operator. But group by bitmap or hll data type are not supported in BE.

Problem summary

Describe your changes.

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions github-actions bot added area/planner Issues or PRs related to the query planner kind/test labels Aug 15, 2022
@@ -160,6 +161,15 @@ public void setPartitionExprs(List<Expr> exprs) {
partitionExprs = exprs;
}

private static void validateGroupingExprs(List<Expr> groupingExprs) throws AnalysisException {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is more reasonable to put this checking logic into GroupByClause's analyze phase.

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 your time. But there is no group by clause in sql like "select distinct bitmap, hll from xxx", the agg node is created by fe to implement the "distinct" operator, so no analyze function is called in that case. Anyway, I update the error message which is consistent with the error "select count(*) from xxx group by bitmap" now.

Copy link
Contributor

@spaces-X spaces-X left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Aug 15, 2022
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit f3f1bbc into apache:master Aug 16, 2022
yiguolei pushed a commit that referenced this pull request Aug 16, 2022
* [fix](agg)disallow group by bitmap or hll data type
@dataroaring dataroaring added the bug/sqlsmith Bug detected by sqlsmith label Aug 23, 2022
@yiguolei yiguolei mentioned this pull request Aug 26, 2022
@yiguolei yiguolei mentioned this pull request Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. area/planner Issues or PRs related to the query planner bug/sqlsmith Bug detected by sqlsmith dev/merge-1.1.2 kind/test reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants