FAQ
Repository: hive
Updated Branches:
   refs/heads/master 9ed5af196 -> 607f14873


HIVE-12865: Exchange partition does not show inputs field for post/pre execute hooks (Aihua Xu, reviewed by Chaoyu Tang)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/607f1487
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/607f1487
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/607f1487

Branch: refs/heads/master
Commit: 607f1487376c71680c7fae769a0d1ce0af0e8b91
Parents: 9ed5af1
Author: Aihua Xu <aihuaxu@apache.org>
Authored: Tue Jan 19 17:09:36 2016 -0500
Committer: Aihua Xu <aihuaxu@apache.org>
Committed: Thu Jan 21 13:46:07 2016 -0500

----------------------------------------------------------------------
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java | 2 ++
  .../apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java | 1 +
  ql/src/test/results/clientnegative/exchange_partition.q.out | 1 +
  ql/src/test/results/clientpositive/exchange_partition.q.out | 3 +++
  .../test/results/clientpositive/exchange_partition2.q.out | 3 +++
  .../test/results/clientpositive/exchange_partition3.q.out | 4 ++++
  ql/src/test/results/clientpositive/exchgpartition2lel.q.out | 9 +++++++++
  7 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
index 94bb73c..995d222 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
@@ -4317,6 +4317,8 @@ public class DDLTask extends Task<DDLWork> implements Serializable {

      for(Partition partition : partitions) {
        // Reuse the partition specs from dest partition since they should be the same
+ work.getInputs().add(new ReadEntity(new Partition(sourceTable, partition.getSpec(), null)));
+
        work.getOutputs().add(new WriteEntity(new Partition(sourceTable, partition.getSpec(), null),
            WriteEntity.WriteType.DELETE));


http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
index 5e6b606..141c2e6 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
@@ -744,6 +744,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer {
      rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
        alterTableExchangePartition), conf));

+ inputs.add(new ReadEntity(sourceTable));
      outputs.add(new WriteEntity(sourceTable, WriteType.DDL_SHARED));
      outputs.add(new WriteEntity(destTable, WriteType.DDL_SHARED));
    }

http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/test/results/clientnegative/exchange_partition.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientnegative/exchange_partition.q.out b/ql/src/test/results/clientnegative/exchange_partition.q.out
index f5e332a..47393ec 100644
--- a/ql/src/test/results/clientnegative/exchange_partition.q.out
+++ b/ql/src/test/results/clientnegative/exchange_partition.q.out
@@ -51,6 +51,7 @@ POSTHOOK: Input: default@ex_table2
  part=part1
  PREHOOK: query: ALTER TABLE ex_table1 EXCHANGE PARTITION (part='part1') WITH TABLE ex_table2
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: default@ex_table2
  PREHOOK: Output: default@ex_table1
  PREHOOK: Output: default@ex_table2
  FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: java.io.IOException Cannot rename the source path. The destination path already exists.)

http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/test/results/clientpositive/exchange_partition.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exchange_partition.q.out b/ql/src/test/results/clientpositive/exchange_partition.q.out
index 9316341..0097450 100644
--- a/ql/src/test/results/clientpositive/exchange_partition.q.out
+++ b/ql/src/test/results/clientpositive/exchange_partition.q.out
@@ -60,10 +60,13 @@ POSTHOOK: Input: ex2@exchange_part_test2
  ds=2013-04-05
  PREHOOK: query: ALTER TABLE ex1.exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE ex2.exchange_part_test2
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: ex2@exchange_part_test2
  PREHOOK: Output: ex1@exchange_part_test1
  PREHOOK: Output: ex2@exchange_part_test2
  POSTHOOK: query: ALTER TABLE ex1.exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE ex2.exchange_part_test2
  POSTHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+POSTHOOK: Input: ex2@exchange_part_test2
+POSTHOOK: Input: ex2@exchange_part_test2@ds=2013-04-05
  POSTHOOK: Output: ex1@exchange_part_test1
  POSTHOOK: Output: ex1@exchange_part_test1@ds=2013-04-05
  POSTHOOK: Output: ex2@exchange_part_test2

http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/test/results/clientpositive/exchange_partition2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exchange_partition2.q.out b/ql/src/test/results/clientpositive/exchange_partition2.q.out
index 05121d8..ed7c956 100644
--- a/ql/src/test/results/clientpositive/exchange_partition2.q.out
+++ b/ql/src/test/results/clientpositive/exchange_partition2.q.out
@@ -48,10 +48,13 @@ POSTHOOK: Input: default@exchange_part_test2
  ds=2013-04-05/hr=1
  PREHOOK: query: ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05', hr='1') WITH TABLE exchange_part_test2
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: default@exchange_part_test2
  PREHOOK: Output: default@exchange_part_test1
  PREHOOK: Output: default@exchange_part_test2
  POSTHOOK: query: ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05', hr='1') WITH TABLE exchange_part_test2
  POSTHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+POSTHOOK: Input: default@exchange_part_test2
+POSTHOOK: Input: default@exchange_part_test2@ds=2013-04-05/hr=1
  POSTHOOK: Output: default@exchange_part_test1
  POSTHOOK: Output: default@exchange_part_test1@ds=2013-04-05/hr=1
  POSTHOOK: Output: default@exchange_part_test2

http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/test/results/clientpositive/exchange_partition3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exchange_partition3.q.out b/ql/src/test/results/clientpositive/exchange_partition3.q.out
index 014be7c..7e431fc 100644
--- a/ql/src/test/results/clientpositive/exchange_partition3.q.out
+++ b/ql/src/test/results/clientpositive/exchange_partition3.q.out
@@ -65,11 +65,15 @@ ds=2013-04-05/hr=2
  PREHOOK: query: -- This will exchange both partitions hr=1 and hr=2
  ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: default@exchange_part_test2
  PREHOOK: Output: default@exchange_part_test1
  PREHOOK: Output: default@exchange_part_test2
  POSTHOOK: query: -- This will exchange both partitions hr=1 and hr=2
  ALTER TABLE exchange_part_test1 EXCHANGE PARTITION (ds='2013-04-05') WITH TABLE exchange_part_test2
  POSTHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+POSTHOOK: Input: default@exchange_part_test2
+POSTHOOK: Input: default@exchange_part_test2@ds=2013-04-05/hr=1
+POSTHOOK: Input: default@exchange_part_test2@ds=2013-04-05/hr=2
  POSTHOOK: Output: default@exchange_part_test1
  POSTHOOK: Output: default@exchange_part_test1@ds=2013-04-05/hr=1
  POSTHOOK: Output: default@exchange_part_test1@ds=2013-04-05/hr=2

http://git-wip-us.apache.org/repos/asf/hive/blob/607f1487/ql/src/test/results/clientpositive/exchgpartition2lel.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/exchgpartition2lel.q.out b/ql/src/test/results/clientpositive/exchgpartition2lel.q.out
index 3fd996a..22ec96b 100644
--- a/ql/src/test/results/clientpositive/exchgpartition2lel.q.out
+++ b/ql/src/test/results/clientpositive/exchgpartition2lel.q.out
@@ -113,10 +113,13 @@ POSTHOOK: Input: default@t3@d1=1/d2=1
  100 1 1
  PREHOOK: query: ALTER TABLE t2 EXCHANGE PARTITION (d1 = 1) WITH TABLE t1
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: default@t1
  PREHOOK: Output: default@t1
  PREHOOK: Output: default@t2
  POSTHOOK: query: ALTER TABLE t2 EXCHANGE PARTITION (d1 = 1) WITH TABLE t1
  POSTHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t1@d1=1
  POSTHOOK: Output: default@t1
  POSTHOOK: Output: default@t1@d1=1
  POSTHOOK: Output: default@t2
@@ -142,10 +145,13 @@ POSTHOOK: Input: default@t2@d1=1
  100 1
  PREHOOK: query: ALTER TABLE t4 EXCHANGE PARTITION (d1 = 1, d2 = 1) WITH TABLE t3
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: default@t3
  PREHOOK: Output: default@t3
  PREHOOK: Output: default@t4
  POSTHOOK: query: ALTER TABLE t4 EXCHANGE PARTITION (d1 = 1, d2 = 1) WITH TABLE t3
  POSTHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+POSTHOOK: Input: default@t3
+POSTHOOK: Input: default@t3@d1=1/d2=1
  POSTHOOK: Output: default@t3
  POSTHOOK: Output: default@t3@d1=1/d2=1
  POSTHOOK: Output: default@t4
@@ -171,10 +177,13 @@ POSTHOOK: Input: default@t4@d1=1/d2=1
  100 1 1
  PREHOOK: query: ALTER TABLE t6 EXCHANGE PARTITION (d1 = 1, d2 = 1, d3 = 1) WITH TABLE t5
  PREHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+PREHOOK: Input: default@t5
  PREHOOK: Output: default@t5
  PREHOOK: Output: default@t6
  POSTHOOK: query: ALTER TABLE t6 EXCHANGE PARTITION (d1 = 1, d2 = 1, d3 = 1) WITH TABLE t5
  POSTHOOK: type: ALTERTABLE_EXCHANGEPARTITION
+POSTHOOK: Input: default@t5
+POSTHOOK: Input: default@t5@d1=1/d2=1/d3=1
  POSTHOOK: Output: default@t5
  POSTHOOK: Output: default@t5@d1=1/d2=1/d3=1
  POSTHOOK: Output: default@t6

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJan 21, '16 at 6:47p
activeJan 21, '16 at 6:47p
posts1
users1
websitehive.apache.org

1 user in discussion

Aihuaxu: 1 post

People

Translate

site design / logo © 2021 Grokbase