Skip to content

Commit 3e6445f

Browse files
authored
fix: handle Decimal64 properly in column_update_hll_cardinality (#18287)
fix: handle Decimal64 in `column_update_hll_cardinality`
1 parent 215aa17 commit 3e6445f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

โ€Žsrc/query/storages/fuse/src/io/write/stream/column_statistics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ fn column_update_hll_cardinality(col: &Column, ty: &DataType, hll: &mut ColumnDi
194194
}
195195
DataType::Decimal(_) => {
196196
match col {
197+
Column::Decimal(DecimalColumn::Decimal64(col, _)) => {
198+
for v in col.iter() {
199+
hll.add_object(v);
200+
}
201+
}
197202
Column::Decimal(DecimalColumn::Decimal128(col, _)) => {
198203
for v in col.iter() {
199204
hll.add_object(v);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# https://github.com/datafuselabs/databend/issues/18286
2+
3+
statement ok
4+
create or replace database issue_18286;
5+
6+
statement ok
7+
use issue_18286;
8+
9+
statement ok
10+
create or replace table t( c DECIMAL(10, 2) not null);
11+
12+
statement ok
13+
insert into t select number / 100 as c from numbers(100);
14+
15+
query T
16+
select count(*) from t;
17+
----
18+
100

0 commit comments

Comments
ย (0)