-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add bitmap agg type and udaf #1610
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
Conversation
fe/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/analysis/CreateTableStmt.java
Outdated
Show resolved
Hide resolved
d86fe4a to
f3cab93
Compare
|
This update contains the following change: 1 Rebase the code |
docs/documentation/cn/sql-reference/sql-functions/aggregate-functions/bitmap_union.md
Outdated
Show resolved
Hide resolved
docs/documentation/cn/sql-reference/sql-functions/aggregate-functions/bitmap.md
Outdated
Show resolved
Hide resolved
|
This update contains the following change: 1 Release row_cursor arena memory immediately |
docs/documentation/cn/sql-reference/sql-functions/aggregate-functions/bitmap.md
Outdated
Show resolved
Hide resolved
|
After tested with real data, I found the bitmap load is very slower than sum. For about one million rows, stream load with sum only need 3 seconds, but stream load with bitmap need 60 seconds. So I did a special improve for empty bitmap and single int bitmap, After the improvement, stream load with bitmap only need 4 seconds. |
docs/documentation/cn/sql-reference/sql-functions/aggregate-functions/bitmap.md
Outdated
Show resolved
Hide resolved
fe/src/main/java/org/apache/doris/analysis/AggregateInfoBase.java
Outdated
Show resolved
Hide resolved
|
Update for @imay comment. |
9dd5a3b to
e8d4422
Compare
|
Rebase the code and Fix UT. |
335da0f to
cd7e973
Compare
cd7e973 to
a28bb83
Compare
imay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
when use the case, there is some error, version 0.11 |
please refer to the bitmap doc: |
|
I use mysql client with the bitmap doc, but there is error if there need some set in client? Server version: 5.1.0 Doris version DORIS-0.11.14-release |
|
fe log Caused by: org.apache.doris.common.AnalysisException: Syntax error |
you can try |
when i create table with sql it works but when insert value there is some error insert into bitmap_test values (10,bitmap_hash('a100'));
|
|
@JackyYangPassion |
|
for #1486 and #1485
The change for this PR:
1 Add a bitmap_union agg type
2 Add a bitmap udaf
3 Add a bitmap_inin function, convert a int value to bitmap
4 Remove aligned_free method in port.h, because which is conflict with RoaringBitmap portability.h.
5 Remove merge method from aggregate_func, becuase all agg input is aggregated intermediate data. So the merge method and update method we only need one.
6 Remove unused Field constructor method
7 Use the Field polymorphism eliminate if-else.
8 why change the AggregateInfo::init api?
because key column and none agg value column no update semantic,so we need fill the dst with src by init method
How to use:
1 creata table with bitmap_union:
2 load the data by stream load:
3 query:
Todo:
add document for bitmap_union
add test for bitmap_union
rewrite count distinct to bitmap_union for bitmap_union agg type column
bitmap_union support insert into select
bitmap_union support broker load
avoid serialize and deserialize from Scannode to Aggnode
add a new type for hll_union and bitmap_union