mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 19:42:00 +00:00
fix reading of columns of type Tuple(Map(LowCardinality(...)))
This commit is contained in:
parent
7aeeaabf3d
commit
bb130f429e
@ -515,8 +515,14 @@ void SerializationLowCardinality::deserializeBinaryBulkWithMultipleStreams(
|
||||
size_t limit,
|
||||
DeserializeBinaryBulkSettings & settings,
|
||||
DeserializeBinaryBulkStatePtr & state,
|
||||
SubstreamsCache * /* cache */) const
|
||||
SubstreamsCache * cache) const
|
||||
{
|
||||
if (auto cached_column = getFromSubstreamsCache(cache, settings.path))
|
||||
{
|
||||
column = cached_column;
|
||||
return;
|
||||
}
|
||||
|
||||
auto mutable_column = column->assumeMutable();
|
||||
ColumnLowCardinality & low_cardinality_column = typeid_cast<ColumnLowCardinality &>(*mutable_column);
|
||||
|
||||
@ -670,6 +676,7 @@ void SerializationLowCardinality::deserializeBinaryBulkWithMultipleStreams(
|
||||
}
|
||||
|
||||
column = std::move(mutable_column);
|
||||
addToSubstreamsCache(cache, settings.path, column);
|
||||
}
|
||||
|
||||
void SerializationLowCardinality::serializeBinary(const Field & field, WriteBuffer & ostr, const FormatSettings & settings) const
|
||||
|
@ -0,0 +1,6 @@
|
||||
100000
|
||||
100000
|
||||
100000
|
||||
100000
|
||||
100000
|
||||
100000
|
@ -0,0 +1,33 @@
|
||||
DROP TABLE IF EXISTS t_map_lc;
|
||||
|
||||
CREATE TABLE t_map_lc
|
||||
(
|
||||
id UInt64,
|
||||
t Tuple(m Map(LowCardinality(String), LowCardinality(String)))
|
||||
)
|
||||
ENGINE = MergeTree ORDER BY id SETTINGS min_bytes_for_wide_part = 0;
|
||||
|
||||
INSERT INTO t_map_lc SELECT * FROM generateRandom('id UInt64, t Tuple(m Map(LowCardinality(String), LowCardinality(String)))') LIMIT 100000;
|
||||
|
||||
SELECT count(), FROM t_map_lc WHERE NOT ignore(*, mapKeys(t.m));
|
||||
SELECT count(), FROM t_map_lc WHERE NOT ignore(*, t.m.keys);
|
||||
SELECT count(), FROM t_map_lc WHERE NOT ignore(*, t.m.values);
|
||||
SELECT * FROM t_map_lc WHERE mapContains(t.m, 'not_existing_key_1337');
|
||||
|
||||
DROP TABLE t_map_lc;
|
||||
|
||||
CREATE TABLE t_map_lc
|
||||
(
|
||||
id UInt64,
|
||||
t Tuple(m Map(LowCardinality(String), LowCardinality(String)))
|
||||
)
|
||||
ENGINE = MergeTree ORDER BY id SETTINGS min_bytes_for_wide_part = '10G';
|
||||
|
||||
INSERT INTO t_map_lc SELECT * FROM generateRandom('id UInt64, t Tuple(m Map(LowCardinality(String), LowCardinality(String)))') LIMIT 100000;
|
||||
|
||||
SELECT count(), FROM t_map_lc WHERE NOT ignore(*, mapKeys(t.m));
|
||||
SELECT count(), FROM t_map_lc WHERE NOT ignore(*, t.m.keys);
|
||||
SELECT count(), FROM t_map_lc WHERE NOT ignore(*, t.m.values);
|
||||
SELECT * FROM t_map_lc WHERE mapContains(t.m, 'not_existing_key_1337');
|
||||
|
||||
DROP TABLE t_map_lc;
|
Loading…
Reference in New Issue
Block a user