-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
ADD BE UDF bitmap_and and bitmap_or #2649
Conversation
…ache#2487] (apache#2573) ### create table with index ``` CREATE TABLE table1 ( siteid INT DEFAULT '10', citycode SMALLINT, username VARCHAR(32) DEFAULT '', pv BIGINT SUM DEFAULT '0', INDEX index_name [USING BITMAP] (siteid, citycode) COMMENT 'balabala' ) AGGREGATE KEY(siteid, citycode, username) DISTRIBUTED BY HASH(siteid) BUCKETS 10 PROPERTIES("replication_num" = "1"); ``` ### create index ``` CREATE INDEX index_name ON table1 (siteid, citycod) [USING BITMAP] COMMENT 'balabala'; or ALTER TABLE table1 ADD INDEX index_name [USING BITMAP] (siteid, citycod) COMMENT 'balabala'; ``` ### drop index ``` DROP INDEX index_name ON table1; or ALTER TABLE table1 DROP INDEX index_name ``` ### show index ``` SHOW INDEX[ES] FROM table1 ``` output ``` +---------+-------------+-----------------+------------+---------+ | Table | Index_name | Column_name | Index_type | Comment | +---------+-------------+-----------------+------------+---------+ | table1 | index_name | siteid,citycode | BITMAMP | balabala| +---------+-------------+-----------------+------------+---------+ ```
…#2553) Add filter conditions for show partitions from table syntax, to filter partitions needed
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.
should update documents for new added functions
@@ -388,6 +388,23 @@ BigIntVal BitmapFunctions::bitmap_intersect_finalize(FunctionContext* ctx, const | |||
return result; | |||
} | |||
|
|||
StringVal BitmapFunctions::bitmap_or(FunctionContext* ctx, const StringVal& src, const StringVal& dst){ |
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.
src and dst can be null, you should handle this case.
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.
OK. I will update doc and fix this case.
@@ -388,6 +388,23 @@ BigIntVal BitmapFunctions::bitmap_intersect_finalize(FunctionContext* ctx, const | |||
return result; | |||
} | |||
|
|||
StringVal BitmapFunctions::bitmap_or(FunctionContext* ctx, const StringVal& src, const StringVal& dst){ | |||
RoaringBitmap src_bitmap ((char*)src.ptr); |
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.
src and dst can be already deserialized, you should handle the different cases.
@@ -29,18 +29,16 @@ | |||
namespace doris { | |||
|
|||
StringVal convert_bitmap_to_string(FunctionContext* ctx, RoaringBitmap& bitmap) { |
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.
StringVal convert_bitmap_to_string(FunctionContext* ctx, RoaringBitmap& bitmap) { | |
StringVal convert_bitmap_to_string(FunctionContext* ctx, const RoaringBitmap& bitmap) { |
In some scenarios, when a user creates an olap table that is range partition by time, the user needs to periodically add and remove partitions to ensure that the data is valid. As a result, adding and removing partitions dynamically can be very useful for users.
This CL supports arrow's zero copy read interface, which can make code comply with arrow 0.15. And the schema change unit test has some problem, I disable it in run-ut.sh
…s into be_bitmap_udf-0.1
bitmap.serialize((char*)result.ptr); | ||
return result; | ||
} | ||
StringVal BitmapFunctions::bitmap_and(FunctionContext* ctx, const StringVal& src, const StringVal& dst){ |
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.
is the third parameter called ‘dst’ appropriate?
…s into be_bitmap_udf-0.1
2.Test environment, modify production bitmap