diff --git a/src/Storages/ColumnsDescription.cpp b/src/Storages/ColumnsDescription.cpp index e11c2477572..a7af2433875 100644 --- a/src/Storages/ColumnsDescription.cpp +++ b/src/Storages/ColumnsDescription.cpp @@ -543,16 +543,9 @@ Names ColumnsDescription::getNamesOfPhysical() const std::optional ColumnsDescription::tryGetColumn(const GetColumnsOptions & options, const String & column_name) const { - auto it = columns.get<1>().find(column_name); - if (it != columns.get<1>().end() && (defaultKindToGetKind(it->default_desc.kind) & options.kind)) - return NameAndTypePair(it->name, it->type); - - if (options.with_subcolumns) - { - auto jt = subcolumns.get<0>().find(column_name); - if (jt != subcolumns.get<0>().end()) - return *jt; - } + auto column_description = tryGetColumnDescription(options, column_name); + if (column_description) + return NameAndTypePair{column_description->name, column_description->type}; return {}; }