mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
fix reading of subcolumns from compact parts
This commit is contained in:
parent
43102e8427
commit
a63887413c
@ -219,7 +219,13 @@ void MergeTreeReaderCompact::readData(
|
|||||||
auto serialization = type_in_storage->getDefaultSerialization();
|
auto serialization = type_in_storage->getDefaultSerialization();
|
||||||
serialization->deserializeBinaryBulkStatePrefix(deserialize_settings, state);
|
serialization->deserializeBinaryBulkStatePrefix(deserialize_settings, state);
|
||||||
serialization->deserializeBinaryBulkWithMultipleStreams(temp_column, rows_to_read, deserialize_settings, state, nullptr);
|
serialization->deserializeBinaryBulkWithMultipleStreams(temp_column, rows_to_read, deserialize_settings, state, nullptr);
|
||||||
column = type_in_storage->getSubcolumn(name_and_type.getSubcolumnName(), *temp_column);
|
|
||||||
|
auto subcolumn = type_in_storage->getSubcolumn(name_and_type.getSubcolumnName(), *temp_column);
|
||||||
|
|
||||||
|
if (column->empty())
|
||||||
|
column = subcolumn;
|
||||||
|
else
|
||||||
|
column->assumeMutable()->insertRangeFrom(*subcolumn, 0, subcolumn->size());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
40000
|
||||||
|
219970
|
14
tests/queries/0_stateless/02025_subcolumns_compact_parts.sql
Normal file
14
tests/queries/0_stateless/02025_subcolumns_compact_parts.sql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
DROP TABLE IF EXISTS t_comp_subcolumns;
|
||||||
|
|
||||||
|
CREATE TABLE t_comp_subcolumns (id UInt32, n Nullable(String), arr Array(Array(UInt32)))
|
||||||
|
ENGINE = MergeTree ORDER BY id;
|
||||||
|
|
||||||
|
INSERT INTO t_comp_subcolumns SELECT number, 'a', [range(number % 11), range(number % 13)] FROM numbers(20000);
|
||||||
|
|
||||||
|
SELECT sum(n.null) FROM t_comp_subcolumns;
|
||||||
|
SELECT n.null FROM t_comp_subcolumns LIMIT 10000, 5;
|
||||||
|
|
||||||
|
SELECT sum(arr.size0) FROM t_comp_subcolumns;
|
||||||
|
SELECT sumArray(arr.size1) FROM t_comp_subcolumns;
|
||||||
|
|
||||||
|
DROP TABLE t_comp_subcolumns;
|
Loading…
Reference in New Issue
Block a user