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

Disable Bitmap or Hll type in keys or in values with incorrect agg-type #3768

Merged
merged 2 commits into from
Jun 6, 2020
Merged

Disable Bitmap or Hll type in keys or in values with incorrect agg-type #3768

merged 2 commits into from
Jun 6, 2020

Conversation

spaces-X
Copy link
Contributor

@spaces-X spaces-X commented Jun 3, 2020

Bitmap and Hll type can not be used with incorrect aggregate functions, which will cause to BE crush.
Add some logical checks in FE's ColumnDef#analyze to avoid creating tables or changing schemas incorrectly.

  • Keys never be bitmap or hll type
  • values with bitmap or hll type have to be associated with bitmap_union or hll_union

@spaces-X
Copy link
Contributor Author

spaces-X commented Jun 3, 2020

issue

@morningman
Copy link
Contributor

issue

Link issue like this: #3769
If you want to close the issue automatically after PR being merged, like this: Fix #3769

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

Please add UT for this case.
You can reference to CreateTableStmtTest.java

@spaces-X
Copy link
Contributor Author

spaces-X commented Jun 4, 2020

Fix #3769

@spaces-X
Copy link
Contributor Author

spaces-X commented Jun 4, 2020

Please add UT for this case.
You can reference to CreateTableStmtTest.java

Done.

primitiveTypeList.add(PrimitiveType.HLL);
compatibilityMap.put(HLL_UNION, EnumSet.copyOf(primitiveTypeList));

primitiveTypeList.clear();

primitiveTypeList.add(PrimitiveType.BITMAP);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the primitiveTypeList.clear();.
Now, the BITMAP_UNION is compatible with both BITMAP and HLL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By mistake.
Thanks for reminding.

keep code style

Co-authored-by: Zhao Chun <buaa.zhaoc@gmail.com>
Copy link
Contributor

@kangkaisen kangkaisen left a comment

Choose a reason for hiding this comment

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

+1, LGTM

@kangkaisen kangkaisen added the approved Indicates a PR has been approved by one committer. label Jun 5, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman added the kind/fix Categorizes issue or PR as related to a bug. label Jun 6, 2020
@imay imay merged commit c51f20b into apache:master Jun 6, 2020
morningman pushed a commit to morningman/doris that referenced this pull request Jun 7, 2020
…pe (apache#3768)

Bitmap and Hll type can not be used with incorrect aggregate functions, which will cause to BE crush.
Add some logical checks in FE's ColumnDef#analyze to avoid creating tables or changing schemas incorrectly.

Keys never be bitmap or hll type
values with bitmap or hll type have to be associated with bitmap_union or hll_union
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Jan 20, 2021
…pe (apache#3768)

Bitmap and Hll type can not be used with incorrect aggregate functions, which will cause to BE crush.
Add some logical checks in FE's ColumnDef#analyze to avoid creating tables or changing schemas incorrectly.

Keys never be bitmap or hll type
values with bitmap or hll type have to be associated with bitmap_union or hll_union
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. kind/fix Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BE will crash when execute stream load, if bitmap field does not specify BITMAP_UNION type.
4 participants