Skip to content

HLL and Bitmap support default value #1895

@HangyuanLiu

Description

@HangyuanLiu

When load date don't have HLL/bitmap value
eg:
CREATE TABLE test_uv_9 (
pin_id bigint(20) NOT NULL COMMENT "",
id bigint(20) NULL COMMENT "",
uv1 hll HLL_UNION NOT NULL COMMENT "",
uv2 hll HLL_UNION NOT NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(pin_id, id)
DISTRIBUTED BY HASH(pin_id) BUCKETS 16
PROPERTIES (
"storage_type" = "COLUMN"
)

We can implement a function empty_hll() to fill default value

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), uv2=empty_hll()" -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, uv1=empty_hll(), uv2=empty_hll()" -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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions