fix tests

This commit is contained in:
Anton Popov 2021-09-09 21:17:54 +03:00
parent 3ff89a4e29
commit 71bf39c69c
2 changed files with 7 additions and 5 deletions

View File

@ -96,11 +96,13 @@ Block StorageSnapshot::getSampleBlockForColumns(const Names & column_names) cons
for (const auto & name : column_names)
{
auto column = columns.tryGetColumnOrSubcolumn(GetColumnsOptions::All, name);
if (column && !isObject(column->type))
auto object_column = object_columns.tryGetColumnOrSubcolumn(GetColumnsOptions::All, name);
if (column && !object_column)
{
res.insert({column->type->createColumn(), column->type, column->name});
}
else if (auto object_column = object_columns.tryGetColumnOrSubcolumn(GetColumnsOptions::All, name))
else if (object_column)
{
res.insert({object_column->type->createColumn(), object_column->type, object_column->name});
}

View File

@ -1,12 +1,12 @@
1 10 a
Tuple(a UInt32, s String)
Tuple(a UInt8, s String)
1 10 a 0
2 sss b 300
3 20 c 0
Tuple(a String, b UInt64, s String)
Tuple(a String, b UInt16, s String)
1 10 a 0
2 sss b 300
3 20 c 0
4 30 400
5 0 qqq 0 foo
Tuple(a String, b UInt64, s String, t String)
Tuple(a String, b UInt16, s String, t String)