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/13 19:37:25 UTC

svn commit: r1617777 [1/2] - in /hive/branches/cbo/ql/src: java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java test/queries/clientpositive/cbo_correctness.q test/results/clientpositive/cbo_correctness.q.out

Author: hashutosh
Date: Wed Aug 13 17:37:24 2014
New Revision: 1617777

URL: http://svn.apache.org/r1617777
Log:
HIVE-7716 : Make cbo_correctness.q tests run on partitioned tables (Ashutosh Chauhan via Harish Butani)

Modified:
    hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.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/parse/SemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=1617777&r1=1617776&r2=1617777&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java Wed Aug 13 17:37:24 2014
@@ -11767,7 +11767,7 @@ public class SemanticAnalyzer extends Ba
   private boolean canHandleQuery() {
     boolean runOptiqPlanner = false;
 
-    if ((queryProperties.getJoinCount() > 1)
+    if ( conf.getBoolVar(ConfVars.HIVE_IN_TEST) || (queryProperties.getJoinCount() > 1)
         && !queryProperties.hasClusterBy()
         && !queryProperties.hasDistributeBy()
         && !queryProperties.hasSortBy()

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=1617777&r1=1617776&r2=1617777&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 Wed Aug 13 17:37:24 2014
@@ -3,27 +3,22 @@ set hive.cbo.enable=true;
 drop table if exists t1;
 drop table if exists t2;
 drop table if exists t3;
-drop table if exists t4;
 
-create table t1(key string, value string, c_int int, c_float float, c_boolean boolean)  row format delimited fields terminated by ',' STORED AS TEXTFILE;
-create table t2(key string, value string, c_int int, c_float float, c_boolean boolean)  row format delimited fields terminated by ',' STORED AS TEXTFILE;
+create table t1(key string, value string, c_int int, c_float float, c_boolean boolean)  partitioned by (dt string) row format delimited fields terminated by ',' STORED AS TEXTFILE;
+create table t2(key string, value string, c_int int, c_float float, c_boolean boolean)  partitioned by (dt string) row format delimited fields terminated by ',' STORED AS TEXTFILE;
 create table t3(key string, value string, c_int int, c_float float, c_boolean boolean)  row format delimited fields terminated by ',' STORED AS TEXTFILE;
-create table t4(key string, value string, c_int int, c_float float, c_boolean boolean)  row format delimited fields terminated by ',' STORED AS TEXTFILE;
 
-load data local inpath '../../data/files/cbo_t1.txt' into table t1;
-load data local inpath '../../data/files/cbo_t2.txt' into table t2;
+load data local inpath '../../data/files/cbo_t1.txt' into table t1 partition (dt='2014');
+load data local inpath '../../data/files/cbo_t2.txt' into table t2 partition (dt='2014');
 load data local inpath '../../data/files/cbo_t3.txt' into table t3;
-load data local inpath '../../data/files/cbo_t4.txt' into table t4;
 
 set hive.stats.dbclass=jdbc:derby;
-analyze table t1 compute statistics;
+analyze table t1 partition (dt) compute statistics;
 analyze table t1 compute statistics for columns key, value, c_int, c_float, c_boolean;
-analyze table t2 compute statistics;
+analyze table t2 partition (dt) compute statistics;
 analyze table t2 compute statistics for columns key, value, c_int, c_float, c_boolean;
 analyze table t3 compute statistics;
 analyze table t3 compute statistics for columns key, value, c_int, c_float, c_boolean;
-analyze table t4 compute statistics;
-analyze table t4 compute statistics for columns key, value, c_int, c_float, c_boolean;
 
 set hive.stats.fetch.column.stats=true;
 set hive.auto.convert.join=false;