This is an automated email from the ASF dual-hosted git repository. dzamo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/drill.git
commit 9d6af6dea6ed6f47f45a2bd064c01bf69d85acbf Author: Volodymyr Vysotskyi <[email protected]> AuthorDate: Sun Feb 12 16:41:28 2023 +0200 DRILL-8400: Fix pruning partitions with pushed transitive predicates --- .../java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java | 2 +- .../test/java/org/apache/drill/exec/TestHivePartitionPruning.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java index c021ebca14..1ce138c0e3 100644 --- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java +++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java @@ -192,7 +192,7 @@ public class HiveStoragePlugin extends AbstractStoragePlugin { @Override public Set<StoragePluginOptimizerRule> getOptimizerRules(OptimizerRulesContext optimizerContext, PlannerPhase phase) { switch (phase) { - case LOGICAL: + case PARTITION_PRUNING: final String defaultPartitionValue = hiveConf.get(ConfVars.DEFAULTPARTITIONNAME.varname); ImmutableSet.Builder<StoragePluginOptimizerRule> ruleBuilder = ImmutableSet.builder(); ruleBuilder.add(HivePushPartitionFilterIntoScan.getFilterOnProject(optimizerContext, defaultPartitionValue)); diff --git a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHivePartitionPruning.java b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHivePartitionPruning.java index 62a2c136ae..608aaf8d1e 100644 --- a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHivePartitionPruning.java +++ b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/TestHivePartitionPruning.java @@ -28,7 +28,6 @@ import org.apache.drill.exec.planner.physical.PlannerSettings; import org.apache.drill.exec.rpc.user.QueryDataBatch; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -163,11 +162,10 @@ public class TestHivePartitionPruning extends HiveTestBase { } @Test // DRILL-6173 - @Ignore("DRILL-8400") public void prunePartitionsBasedOnTransitivePredicates() throws Exception { - String query = String.format("SELECT * FROM hive.partition_pruning_test t1 " + + String query = "SELECT * FROM hive.partition_pruning_test t1 " + "JOIN hive.partition_with_few_schemas t2 ON t1.`d` = t2.`d` AND t1.`e` = t2.`e` " + - "WHERE t2.`e` IS NOT NULL AND t1.`d` = 1"); + "WHERE t2.`e` IS NOT NULL AND t1.`d` = 1"; int actualRowCount = testSql(query); int expectedRowCount = 450;
