Uh oh!
There was an error while loading. Please reload this page.
HLL support default value - #1825
Conversation
imay
commented
Sep 18, 2019
@HangyuanLiu |
| char* mem = arena->Allocate(dst_slice->size); | ||
| dst_slice->data = (char*) new (mem) HyperLogLog(src_slice->data); | ||
| if (src_slice->empty()) { | ||
| dst_slice->data = (char*) new (mem) HyperLogLog(); |
There was a problem hiding this comment.
When the slice size is empty?
There was a problem hiding this comment.
When HLL columns are NULL in the LOAD data
HangyuanLiu
commented
Sep 19, 2019
Update example @imay |
kangkaisen
commented
Sep 19, 2019
I think we don't support this usage. When load data with HLL column, we must use hll_hash function, hll_hash function will handle null value. |
HangyuanLiu
commented
Sep 19, 2019
This PR will support this capability. |
kangkaisen
commented
Sep 19, 2019
@HangyuanLiu Hi, I See. |
@kangkaisen LOAD LABEL test.uv LOAD LABEL test.uv uv2 may be another business stream |
@HangyuanLiu I think using If user assign nothing to HLL column, HLL column's content will be undefined. Because HLL is not like other types of column, which can be filled by default value or null.
And also, should will add a function |
kangkaisen
commented
Sep 21, 2019
@morningman I agree with you. |
imay
commented
Sep 21, 2019
I agree too Will you add a hll_empty() function? And it will be better if you can create an issue to record this improvement. |
HangyuanLiu
commented
Sep 21, 2019
OK,I can add a function |
…to hll_default Conflicts: be/src/olap/aggregate_func.h
| const int HLL_EMPTY_SIZE = 1; | ||
| std::string buf; | ||
| std::unique_ptr<HyperLogLog> hll; | ||
| hll.reset(new HyperLogLog()); |
6ed3dfb to
c8de048Comparec8de048 to
7105674Compare# Conflicts: # be/src/exprs/hll_function.cpp
| int64_t estimate_cardinality(); | ||
| std::string empty() { |
There was a problem hiding this comment.
why not make this function static?
| HLL_HASH(column_name) | ||
| 生成HLL列类型,用于insert或导入的时候,导入的使用见相关说明 | ||
| EMPTY_HLL() |
fe966b0 to
25f3a6aCompare
When load date don't have HLL value , HLL value is a empty HyperLogLog
eg:
CREATE TABLE
test_uv_9(pin_idbigint(20) NOT NULL COMMENT "",idbigint(20) NULL COMMENT "",uv1hll HLL_UNION NOT NULL COMMENT "",uv2hll HLL_UNION NOT NULL COMMENT "") ENGINE=OLAP
AGGREGATE KEY(
pin_id,id)DISTRIBUTED BY HASH(
pin_id) BUCKETS 16PROPERTIES (
"storage_type" = "COLUMN"
)
1、curl --location-trusted -u root:123456 -H column_separator:, -H label:test_uv_14 -H "columns:pin_id,idx,u1,u2,id=12 ,uv1=hll_hash(u1)" -T uv_test http://11.40.166.162:8030/api/test/test_uv_9/_stream_load
Result :hll_union_agg(uv2) should be 0,And hll_union_agg(uv1) has values > 0
2、curl --location-trusted -u root:123456 -H column_separator:, -H label:test_uv_15 -H "columns:pin_id,idx,u1,u2,id=12" -T uv_test http://11.40.166.162:8030/api/test/test_uv_10/_stream_load
Result :hll_union_agg(uv1) and hll_union_agg(uv2) should be 0