hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhbut...@apache.org
Subject svn commit: r1619965 - in /hive/branches/cbo/ql/src: java/org/apache/hadoop/hive/ql/optimizer/optiq/RelOptHiveTable.java test/queries/clientpositive/cbo_correctness.q test/results/clientpositive/cbo_correctness.q.out
Date Sat, 23 Aug 2014 04:30:46 GMT
Author: rhbutani
Date: Sat Aug 23 04:30:46 2014
New Revision: 1619965

URL: http://svn.apache.org/r1619965
Log:
HIVE-7864 [CBO] Query fails if it refers only partitioning column (Ashutosh Chauhan)

Modified:
    hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/RelOptHiveTable.java
    hive/branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q
    hive/branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/RelOptHiveTable.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/RelOptHiveTable.java?rev=1619965&r1=1619964&r2=1619965&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/RelOptHiveTable.java
(original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/RelOptHiveTable.java
Sat Aug 23 04:30:46 2014
@@ -176,16 +176,16 @@ public class RelOptHiveTable extends Rel
       }
     }
 
+    if (null == partitionList) {
+      // We could be here either because its an unpartitioned table or because
+      // there are no pruning predicates on a partitioned table.
+      computePartitionList(m_hiveConf, null);
+    }
+
     // 2. Obtain Col Stats for Non Partition Cols
     if (nonPartColNamesThatRqrStats.size() > 0) {
       List<ColStatistics> hiveColStats;
 
-      if (null == partitionList) {
-        // We could be here either because its an unpartitioned table or because
-        // there are no pruning predicates on a partitioned table.
-        computePartitionList(m_hiveConf, null);
-      }
-
       if (!m_hiveTblMetadata.isPartitioned()) {
         // 2.1 Handle the case for unpartitioned table.
         hiveColStats = StatsUtils.getTableColumnStats(m_hiveTblMetadata, m_hiveNonPartitionCols,

Modified: hive/branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q?rev=1619965&r1=1619964&r2=1619965&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q (original)
+++ hive/branches/cbo/ql/src/test/queries/clientpositive/cbo_correctness.q Sat Aug 23 04:30:46
2014
@@ -220,3 +220,6 @@ select null from t3;
 
 -- 14. unary operator
 select key from t1 where c_int = -6  or c_int = +6;
+
+-- 15. query referencing only partition columns
+select count(t1.dt) from t1 join t2 on t1.dt  = t2.dt  where t1.dt = '2014' ;

Modified: hive/branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out?rev=1619965&r1=1619964&r2=1619965&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out (original)
+++ hive/branches/cbo/ql/src/test/results/clientpositive/cbo_correctness.q.out Sat Aug 23
04:30:46 2014
@@ -17894,3 +17894,20 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@t1
 POSTHOOK: Input: default@t1@dt=2014
 #### A masked pattern was here ####
+PREHOOK: query: -- 15. query referencing only partition columns
+select count(t1.dt) from t1 join t2 on t1.dt  = t2.dt  where t1.dt = '2014'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t1@dt=2014
+PREHOOK: Input: default@t2
+PREHOOK: Input: default@t2@dt=2014
+#### A masked pattern was here ####
+POSTHOOK: query: -- 15. query referencing only partition columns
+select count(t1.dt) from t1 join t2 on t1.dt  = t2.dt  where t1.dt = '2014'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t1@dt=2014
+POSTHOOK: Input: default@t2
+POSTHOOK: Input: default@t2@dt=2014
+#### A masked pattern was here ####
+400



Mime
View raw message