diff --git a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp index ed6d5afaf09..aa6ef1a35f1 100644 --- a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp +++ b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp @@ -276,8 +276,8 @@ MergeTreeReadTaskColumns getReadTaskColumns( Names pre_column_names; /// inject columns required for defaults evaluation - bool should_reorder = !injectRequiredColumns( - storage, storage_snapshot, data_part, with_subcolumns, column_names).empty(); + injectRequiredColumns( + storage, storage_snapshot, data_part, with_subcolumns, column_names); MergeTreeReadTaskColumns result; auto options = GetColumnsOptions(GetColumnsOptions::All).withExtendedObjects(); @@ -315,9 +315,6 @@ MergeTreeReadTaskColumns getReadTaskColumns( const auto injected_pre_columns = injectRequiredColumns( storage, storage_snapshot, data_part, with_subcolumns, all_pre_column_names); - if (!injected_pre_columns.empty()) - should_reorder = true; - for (const auto & name : all_pre_column_names) { if (pre_name_set.contains(name)) @@ -342,9 +339,8 @@ MergeTreeReadTaskColumns getReadTaskColumns( result.pre_columns.push_back(storage_snapshot->getColumnsByNames(options, pre_column_names)); ////////////// - /// 3. Rest of the requested columns + /// 3. Rest of the requested columns result.columns = storage_snapshot->getColumnsByNames(options, column_names); - result.should_reorder = should_reorder; return result; } diff --git a/src/Storages/MergeTree/MergeTreeBlockReadUtils.h b/src/Storages/MergeTree/MergeTreeBlockReadUtils.h index a3e754f83c3..d0cdedb09c0 100644 --- a/src/Storages/MergeTree/MergeTreeBlockReadUtils.h +++ b/src/Storages/MergeTree/MergeTreeBlockReadUtils.h @@ -36,8 +36,6 @@ struct MergeTreeReadTaskColumns NamesAndTypesList columns; /// column names to read during each PREWHERE step std::vector pre_columns; - /// resulting block may require reordering in accordance with `ordered_names` - bool should_reorder = false; std::string dump() const { @@ -73,8 +71,6 @@ struct MergeTreeReadTask // const NamesAndTypesList & pre_columns; /// should PREWHERE column be returned to requesting side? const bool remove_prewhere_column; -// /// resulting block may require reordering in accordance with `ordered_names` -// const bool should_reorder; /// Used to satistfy preferred_block_size_bytes limitation MergeTreeBlockSizePredictorPtr size_predictor; /// Used to save current range processing status