diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java index 590b828..93c6d11 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java @@ -6498,6 +6498,7 @@ private void checkAcidConstraints(QB qb, TableDesc tableDesc, conf.setIntVar(ConfVars.HIVEOPTREDUCEDEDUPLICATIONMINREDUCER, 1); conf.setBoolVar(ConfVars.HIVE_HADOOP_SUPPORTS_SUBDIRECTORIES, true); conf.set(AcidUtils.CONF_ACID_KEY, "true"); + conf.setBoolVar(ConfVars.HIVEOPTSORTDYNAMICPARTITION, false); if (table.getNumBuckets() < 1) { throw new SemanticException(ErrorMsg.ACID_OP_ON_NONACID_TABLE, table.getTableName()); diff --git ql/src/test/results/clientpositive/dynpart_sort_optimization_acid.q.out ql/src/test/results/clientpositive/dynpart_sort_optimization_acid.q.out index 8ebbdc3..619200d 100644 --- ql/src/test/results/clientpositive/dynpart_sort_optimization_acid.q.out +++ ql/src/test/results/clientpositive/dynpart_sort_optimization_acid.q.out @@ -1057,9 +1057,8 @@ POSTHOOK: query: explain update acid set key = 'foo' where value = 'bar' and ds= POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage - Stage-2 depends on stages: Stage-1 - Stage-0 depends on stages: Stage-2 - Stage-3 depends on stages: Stage-0 + Stage-0 depends on stages: Stage-1 + Stage-2 depends on stages: Stage-0 STAGE PLANS: Stage: Stage-1 @@ -1075,6 +1074,7 @@ STAGE PLANS: Reduce Output Operator key expressions: _col0 (type: struct) sort order: + + Map-reduce partition columns: UDFToInteger(_col0) (type: int) value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int) Reduce Operator Tree: Select Operator @@ -1083,24 +1083,6 @@ STAGE PLANS: File Output Operator compressed: false table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe - - Stage: Stage-2 - Map Reduce - Map Operator Tree: - TableScan - Reduce Output Operator - key expressions: _col3 (type: string), _col4 (type: int), '_bucket_number' (type: string), _col0 (type: struct) - sort order: ++++ - Map-reduce partition columns: _col3 (type: string), _col4 (type: int) - value expressions: _col0 (type: struct), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), '_bucket_number' (type: string) - Reduce Operator Tree: - Extract - File Output Operator - compressed: false - table: input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde @@ -1119,7 +1101,7 @@ STAGE PLANS: serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde name: default.acid - Stage: Stage-3 + Stage: Stage-2 Stats-Aggr Operator PREHOOK: query: update acid set key = 'foo' where value = 'bar' and ds='2008-04-08' and hr=11 @@ -1149,9 +1131,8 @@ POSTHOOK: query: explain update acid set key = 'foo' where value = 'bar' and ds= POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage - Stage-2 depends on stages: Stage-1 - Stage-0 depends on stages: Stage-2 - Stage-3 depends on stages: Stage-0 + Stage-0 depends on stages: Stage-1 + Stage-2 depends on stages: Stage-0 STAGE PLANS: Stage: Stage-1 @@ -1167,6 +1148,7 @@ STAGE PLANS: Reduce Output Operator key expressions: _col0 (type: struct) sort order: + + Map-reduce partition columns: UDFToInteger(_col0) (type: int) value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int) Reduce Operator Tree: Select Operator @@ -1175,24 +1157,6 @@ STAGE PLANS: File Output Operator compressed: false table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe - - Stage: Stage-2 - Map Reduce - Map Operator Tree: - TableScan - Reduce Output Operator - key expressions: _col3 (type: string), _col4 (type: int), '_bucket_number' (type: string), _col0 (type: struct) - sort order: ++++ - Map-reduce partition columns: _col3 (type: string), _col4 (type: int) - value expressions: _col0 (type: struct), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), '_bucket_number' (type: string) - Reduce Operator Tree: - Extract - File Output Operator - compressed: false - table: input format: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat output format: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde @@ -1211,7 +1175,7 @@ STAGE PLANS: serde: org.apache.hadoop.hive.ql.io.orc.OrcSerde name: default.acid - Stage: Stage-3 + Stage: Stage-2 Stats-Aggr Operator PREHOOK: query: update acid set key = 'foo' where value = 'bar' and ds='2008-04-08' and hr>=11