Allow multiple columns in StorageFuzzJSON

This commit is contained in:
Julia Kartseva 2023-12-19 02:33:44 +00:00
parent 0fc402c106
commit 6014dca114
3 changed files with 15 additions and 1 deletions

View File

@ -481,7 +481,11 @@ protected:
{
Columns columns;
columns.reserve(block_header.columns());
columns.emplace_back(createColumn());
for (const auto& col : block_header)
{
chassert(col.type->getTypeId() == TypeIndex::String);
columns.emplace_back(createColumn());
}
return {std::move(columns), block_size};
}

View File

@ -1,3 +1,4 @@
100
100
100
100 100

View File

@ -54,3 +54,12 @@ ENGINE = FuzzJSON('{"pet":"rat"}', NULL); -- { serverError BAD_ARGUMENTS }
DROP TABLE IF EXISTS 02919_test_table_invalid_col_type;
--
DROP TABLE IF EXISTS 02919_test_multi_col;
CREATE TABLE 02919_test_multi_col
(
str1 String,
str2 String
) ENGINE = FuzzJSON('{"pet":"rat"}', 999);
SELECT count(str1), count(str2) FROM (SELECT str1, str2 FROM 02919_test_multi_col LIMIT 100);
DROP TABLE IF EXISTS 02919_test_multi_col;