mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix LowCardinality empty array serialization. #3907
This commit is contained in:
parent
06095340c7
commit
cea23a1486
@ -508,6 +508,10 @@ void DataTypeLowCardinality::serializeBinaryBulkWithMultipleStreams(
|
||||
size_t max_limit = column.size() - offset;
|
||||
limit = limit ? std::min(limit, max_limit) : max_limit;
|
||||
|
||||
/// Do not write anything for empty column. (May happen while writing empty arrays.)
|
||||
if (limit == 0)
|
||||
return;
|
||||
|
||||
auto sub_column = low_cardinality_column.cutAndCompact(offset, limit);
|
||||
ColumnPtr positions = sub_column->getIndexesPtr();
|
||||
ColumnPtr keys = sub_column->getDictionary().getNestedColumn();
|
||||
|
@ -0,0 +1,2 @@
|
||||
[]
|
||||
[]
|
@ -0,0 +1,7 @@
|
||||
drop table if exists test.lc;
|
||||
create table test.lc (names Array(LowCardinality(String))) engine=MergeTree order by tuple();
|
||||
insert into test.lc values ([]);
|
||||
insert into test.lc select emptyArrayString();
|
||||
select * from test.lc;
|
||||
drop table if exists test.lc;
|
||||
|
Loading…
Reference in New Issue
Block a user