You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2014/08/25 20:01:35 UTC
svn commit: r1620394 - 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
Author: hashutosh
Date: Mon Aug 25 18:01:35 2014
New Revision: 1620394
URL: http://svn.apache.org/r1620394
Log:
HIVE-7860 : [CBO] Query on partitioned table which filter out all partitions fails (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=1620394&r1=1620393&r2=1620394&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 Mon Aug 25 18:01:35 2014
@@ -208,6 +208,16 @@ public class RelOptHiveTable extends Rel
} else {
// 2.2 Obtain col stats for partitioned table.
try {
+ if (partitionList.getNotDeniedPartns().isEmpty()) {
+ // no need to make a metastore call
+ m_rowCount = 0;
+ hiveColStats = new ArrayList<ColStatistics>();
+ for (String c : nonPartColNamesThatRqrStats) {
+ // add empty stats object for each column
+ hiveColStats.add(new ColStatistics(m_hiveTblMetadata.getTableName(), c, null));
+ }
+ colNamesFailedStats.clear();
+ } else {
Statistics stats = StatsUtils.collectStatistics(m_hiveConf, partitionList,
m_hiveTblMetadata, m_hiveNonPartitionCols, nonPartColNamesThatRqrStats, true, true);
m_rowCount = stats.getNumRows();
@@ -220,6 +230,7 @@ public class RelOptHiveTable extends Rel
colNamesFailedStats.add(c);
}
}
+ }
} catch (HiveException e) {
String logMsg = "Collecting stats failed.";
LOG.error(logMsg);
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=1620394&r1=1620393&r2=1620394&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 Mon Aug 25 18:01:35 2014
@@ -450,3 +450,8 @@ from (select b.key, count(*)
)
) a
;
+
+-- 17. get stats with empty partition list
+select t1.value from t1 join t2 on t1.key = t2.key where t1.dt = '10' and t1.c_boolean = true;
+
+
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=1620394&r1=1620393&r2=1620394&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 Mon Aug 25 18:01:35 2014
@@ -19175,3 +19175,17 @@ POSTHOOK: Input: default@src_cbo
96 1
97 2
98 2
+PREHOOK: query: -- 17. get stats with empty partition list
+select t1.value from t1 join t2 on t1.key = t2.key where t1.dt = '10' and t1.c_boolean = true
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Input: default@t2@dt=2014
+#### A masked pattern was here ####
+POSTHOOK: query: -- 17. get stats with empty partition list
+select t1.value from t1 join t2 on t1.key = t2.key where t1.dt = '10' and t1.c_boolean = true
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Input: default@t2@dt=2014
+#### A masked pattern was here ####