diff --git a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp index 411695fac3b..9b8deb308b1 100644 --- a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp +++ b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp @@ -246,9 +246,9 @@ MergeTreeReadTaskColumns getReadTaskColumns(const MergeTreeData & storage, const if (check_columns) { - const NamesAndTypesList & columns = storage.getColumns().getAll(); - result.pre_columns = columns.addTypes(pre_column_names); - result.columns = columns.addTypes(column_names); + const NamesAndTypesList & physical_columns = storage.getColumns().getAllPhysical(); + result.pre_columns = physical_columns.addTypes(pre_column_names); + result.columns = physical_columns.addTypes(column_names); } else {