mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
fix nested and scalar columns with dot
This commit is contained in:
parent
be4c9102d8
commit
ee7f50396b
@ -141,7 +141,7 @@ NamesAndTypesList collect(const NamesAndTypesList & names_and_types)
|
||||
auto nested_types = getSubcolumnsOfNested(names_and_types);
|
||||
|
||||
for (const auto & name_type : names_and_types)
|
||||
if (!nested_types.count(splitName(name_type.name).first))
|
||||
if (!isArray(name_type.type) || !nested_types.count(splitName(name_type.name).first))
|
||||
res.push_back(name_type);
|
||||
|
||||
for (const auto & name_type : nested_types)
|
||||
@ -157,6 +157,9 @@ NamesAndTypesList convertToSubcolumns(const NamesAndTypesList & names_and_types)
|
||||
|
||||
for (auto & name_type : res)
|
||||
{
|
||||
if (!isArray(name_type.type))
|
||||
continue;
|
||||
|
||||
auto split = splitName(name_type.name);
|
||||
if (name_type.isSubcolumn() || split.second.empty())
|
||||
continue;
|
||||
|
@ -0,0 +1,3 @@
|
||||
1 [0,0] 2 [1,1,3]
|
||||
1 [0,0] 2 [1,1,3]
|
||||
1 [0,0] 2 [1,1,3]
|
24
tests/queries/0_stateless/02017_columns_with_dot.sql
Normal file
24
tests/queries/0_stateless/02017_columns_with_dot.sql
Normal file
@ -0,0 +1,24 @@
|
||||
DROP TABLE IF EXISTS t_with_dots;
|
||||
CREATE TABLE t_with_dots (id UInt32, arr Array(UInt32), `b.id` UInt32, `b.arr` Array(UInt32)) ENGINE = Log;
|
||||
|
||||
INSERT INTO t_with_dots VALUES (1, [0, 0], 2, [1, 1, 3]);
|
||||
SELECT * FROM t_with_dots;
|
||||
|
||||
DROP TABLE t_with_dots;
|
||||
|
||||
CREATE TABLE t_with_dots (id UInt32, arr Array(UInt32), `b.id` UInt32, `b.arr` Array(UInt32))
|
||||
ENGINE = MergeTree ORDER BY id;
|
||||
|
||||
INSERT INTO t_with_dots VALUES (1, [0, 0], 2, [1, 1, 3]);
|
||||
SELECT * FROM t_with_dots;
|
||||
|
||||
DROP TABLE t_with_dots;
|
||||
|
||||
CREATE TABLE t_with_dots (id UInt32, arr Array(UInt32), `b.id` UInt32, `b.arr` Array(UInt32))
|
||||
ENGINE = MergeTree ORDER BY id
|
||||
SETTINGS min_bytes_for_wide_part = 0;
|
||||
|
||||
INSERT INTO t_with_dots VALUES (1, [0, 0], 2, [1, 1, 3]);
|
||||
SELECT * FROM t_with_dots;
|
||||
|
||||
DROP TABLE t_with_dots;
|
Loading…
Reference in New Issue
Block a user