mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Try fix tests
This commit is contained in:
parent
78069765bb
commit
3bad21cea7
@ -196,7 +196,7 @@ static auto getNameRange(const ColumnsDescription::ColumnsContainer & columns, c
|
||||
return std::make_pair(begin, end);
|
||||
}
|
||||
|
||||
void ColumnsDescription::add(ColumnDescription column, const String & after_column, bool first)
|
||||
void ColumnsDescription::add(ColumnDescription column, const String & after_column, bool first, bool add_subcolumns)
|
||||
{
|
||||
if (has(column.name))
|
||||
throw Exception("Cannot add column " + column.name + ": column with this name already exists",
|
||||
@ -222,7 +222,8 @@ void ColumnsDescription::add(ColumnDescription column, const String & after_colu
|
||||
insert_it = range.second;
|
||||
}
|
||||
|
||||
addSubcolumns(column.name, column.type);
|
||||
if (add_subcolumns)
|
||||
addSubcolumns(column.name, column.type);
|
||||
columns.get<0>().insert(insert_it, std::move(column));
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
explicit ColumnsDescription(NamesAndTypesList ordinary, NamesAndAliases aliases);
|
||||
|
||||
/// `after_column` can be a Nested column name;
|
||||
void add(ColumnDescription column, const String & after_column = String(), bool first = false);
|
||||
void add(ColumnDescription column, const String & after_column = String(), bool first = false, bool add_subcolumns = true);
|
||||
/// `column_name` can be a Nested column name;
|
||||
void remove(const String & column_name);
|
||||
|
||||
|
@ -106,14 +106,14 @@ ColumnsDescription StorageSnapshot::getDescriptionForColumns(const Names & colum
|
||||
for (const auto & name : column_names)
|
||||
{
|
||||
auto column = columns.tryGetColumnOrSubcolumnDescription(GetColumnsOptions::All, name);
|
||||
auto object_column = object_columns.tryGetColumnOrSubcolumn(GetColumnsOptions::All, name);
|
||||
auto object_column = object_columns.tryGetColumnOrSubcolumnDescription(GetColumnsOptions::All, name);
|
||||
if (column && !object_column)
|
||||
{
|
||||
res.add(*column);
|
||||
res.add(*column, "", false, false);
|
||||
}
|
||||
else if (object_column)
|
||||
{
|
||||
res.add({object_column->name, object_column->type});
|
||||
res.add(*object_column, "", false, false);
|
||||
}
|
||||
else if (auto it = virtual_columns.find(name); it != virtual_columns.end())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user