From 6111a5ea834ccf7604739abc0a64be89959ac102 Mon Sep 17 00:00:00 2001 From: kakachen Date: Mon, 25 Nov 2024 00:28:21 +0800 Subject: [PATCH] Init Commit. --- be/src/vec/exec/format/orc/vorc_reader.cpp | 33 +++++++--------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/be/src/vec/exec/format/orc/vorc_reader.cpp b/be/src/vec/exec/format/orc/vorc_reader.cpp index 70f3f6f003f6117..5968157e12b20e7 100644 --- a/be/src/vec/exec/format/orc/vorc_reader.cpp +++ b/be/src/vec/exec/format/orc/vorc_reader.cpp @@ -1018,8 +1018,7 @@ Status OrcReader::set_fill_columns( } } - if (!_has_complex_type && _enable_lazy_mat && - _lazy_read_ctx.predicate_columns.first.size() > 0 && + if (_enable_lazy_mat && _lazy_read_ctx.predicate_columns.first.size() > 0 && _lazy_read_ctx.lazy_read_columns.size() > 0) { _lazy_read_ctx.can_lazy_read = true; } @@ -1891,16 +1890,8 @@ Status OrcReader::get_next_block_impl(Block* block, size_t* read_rows, bool* eof RETURN_IF_CATCH_EXCEPTION( Block::filter_block_internal(block, columns_to_filter, *_filter)); } - if (!_not_single_slot_filter_conjuncts.empty()) { - RETURN_IF_ERROR(_convert_dict_cols_to_string_cols(block, &batch_vec)); - RETURN_IF_CATCH_EXCEPTION( - RETURN_IF_ERROR(VExprContext::execute_conjuncts_and_filter_block( - _not_single_slot_filter_conjuncts, block, columns_to_filter, - column_to_keep))); - } else { - Block::erase_useless_column(block, column_to_keep); - RETURN_IF_ERROR(_convert_dict_cols_to_string_cols(block, &batch_vec)); - } + Block::erase_useless_column(block, column_to_keep); + RETURN_IF_ERROR(_convert_dict_cols_to_string_cols(block, &batch_vec)); *read_rows = block->rows(); } else { uint64_t rr; @@ -2017,17 +2008,8 @@ Status OrcReader::get_next_block_impl(Block* block, size_t* read_rows, bool* eof RETURN_IF_CATCH_EXCEPTION( Block::filter_block_internal(block, columns_to_filter, result_filter)); } - //_not_single_slot_filter_conjuncts check : missing column1 == missing column2 , missing column == exists column ... - if (!_not_single_slot_filter_conjuncts.empty()) { - RETURN_IF_ERROR(_convert_dict_cols_to_string_cols(block, &batch_vec)); - RETURN_IF_CATCH_EXCEPTION( - RETURN_IF_ERROR(VExprContext::execute_conjuncts_and_filter_block( - _not_single_slot_filter_conjuncts, block, columns_to_filter, - column_to_keep))); - } else { - Block::erase_useless_column(block, column_to_keep); - RETURN_IF_ERROR(_convert_dict_cols_to_string_cols(block, &batch_vec)); - } + Block::erase_useless_column(block, column_to_keep); + RETURN_IF_ERROR(_convert_dict_cols_to_string_cols(block, &batch_vec)); } else { if (_delete_rows_filter_ptr) { _execute_filter_position_delete_rowids(*_delete_rows_filter_ptr); @@ -2195,6 +2177,11 @@ Status OrcReader::fill_dict_filter_column_names( std::unique_ptr current_strip_information, std::list& column_names) { // Check if single slot can be filtered by dict. + if (!_not_single_slot_filter_conjuncts.empty()) { + _filter_conjuncts.insert(_filter_conjuncts.end(), _not_single_slot_filter_conjuncts.begin(), + _not_single_slot_filter_conjuncts.end()); + return Status::OK(); + } if (!_slot_id_to_filter_conjuncts) { return Status::OK(); }