From b0a1514c87beb388e1873775d9ca223b1709432b Mon Sep 17 00:00:00 2001 From: daidai Date: Fri, 10 Jan 2025 18:18:27 +0800 Subject: [PATCH] [fix](hive)fix select count(*) hive full acid tb opt error. (#46732) Problem Summary: before pr : #44038 In the previous PR, the generation method of split in the count( * ) scenario was optimized. However, there were some problems with the hive acid table. This PR mainly fixes this and adds tests. In the count( * ) scenario, reading the hive full acid table cannot be optimized, and the file still needs to be split (merge on read is required), and the hive insert only acid table does not need to be split. --- .../format/table/transactional_hive_reader.cpp | 1 + .../datasource/hive/source/HiveScanNode.java | 4 ++-- .../hive/test_transactional_hive.out | 15 +++++++++++++++ .../hive/test_hive_translation_insert_only.out | 10 ++++++++++ .../hive/test_transactional_hive.groovy | 12 ++++++++++++ .../hive/test_hive_translation_insert_only.groovy | 5 +++++ 6 files changed, 45 insertions(+), 2 deletions(-) diff --git a/be/src/vec/exec/format/table/transactional_hive_reader.cpp b/be/src/vec/exec/format/table/transactional_hive_reader.cpp index bc4262b7451d53..f840b0af2522fc 100644 --- a/be/src/vec/exec/format/table/transactional_hive_reader.cpp +++ b/be/src/vec/exec/format/table/transactional_hive_reader.cpp @@ -180,6 +180,7 @@ Status TransactionalHiveReader::init_row_filters(const TFileRangeDesc& range, ++num_delete_files; } if (num_delete_rows > 0) { + orc_reader->set_push_down_agg_type(TPushAggOp::NONE); orc_reader->set_delete_rows(&_delete_rows); COUNTER_UPDATE(_transactional_orc_profile.num_delete_files, num_delete_files); COUNTER_UPDATE(_transactional_orc_profile.num_delete_rows, num_delete_rows); diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java index 1e09fa6d909309..b14dfbf02f425d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java @@ -292,12 +292,12 @@ private void getFileSplitByPartitions(HiveMetaStoreCache cache, List