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 2017/11/13 21:29:54 UTC

hive git commit: HIVE-16406 : Remove unwanted interning when creating PartitionDesc (Rajesh Balamohan via Ashutosh Chauhan)

Repository: hive
Updated Branches:
  refs/heads/master 25a6f4cf3 -> 7150f9c83


HIVE-16406 : Remove unwanted interning when creating PartitionDesc (Rajesh Balamohan via Ashutosh Chauhan)

Signed-off-by: Ashutosh Chauhan <ha...@apache.org>


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

Branch: refs/heads/master
Commit: 7150f9c83b8ad0a9bf7ea47fa905dd01b0f26d21
Parents: 25a6f4c
Author: Rajesh Balamohan <rb...@apache.org>
Authored: Fri Apr 7 02:52:00 2017 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Mon Nov 13 13:29:19 2017 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/exec/Utilities.java     |  5 +++++
 .../hadoop/hive/ql/optimizer/GenMapRedUtils.java      |  8 ++++----
 .../org/apache/hadoop/hive/ql/plan/PartitionDesc.java | 14 ++++++++------
 3 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/7150f9c8/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
index 00590e3..29c33f9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
@@ -776,6 +776,11 @@ public final class Utilities {
         serdeConstants.SERIALIZATION_LIB,LazySimpleSerDe.class.getName())));
   }
 
+  public static PartitionDesc getPartitionDesc(Partition part, TableDesc tableDesc) throws
+      HiveException {
+    return new PartitionDesc(part, tableDesc);
+  }
+
   public static PartitionDesc getPartitionDesc(Partition part) throws HiveException {
     return new PartitionDesc(part);
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/7150f9c8/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
index d86162b..67739a1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
@@ -514,10 +514,11 @@ public final class GenMapRedUtils {
     // pass both confirmed and unknown partitions through the map-reduce
     // framework
     Set<Partition> parts = partsList.getPartitions();
+    TableDesc tableSpec = Utilities.getTableDesc(tsOp.getConf().getTableMetadata());
     PartitionDesc aliasPartnDesc = null;
     try {
       if (!parts.isEmpty()) {
-        aliasPartnDesc = Utilities.getPartitionDesc(parts.iterator().next());
+        aliasPartnDesc = Utilities.getPartitionDesc(parts.iterator().next(), tableSpec);
       }
     } catch (HiveException e) {
       LOG.error(org.apache.hadoop.util.StringUtils.stringifyException(e));
@@ -526,8 +527,7 @@ public final class GenMapRedUtils {
 
     // The table does not have any partitions
     if (aliasPartnDesc == null) {
-      aliasPartnDesc = new PartitionDesc(Utilities.getTableDesc(tsOp
-          .getConf().getTableMetadata()), null);
+      aliasPartnDesc = new PartitionDesc(tableSpec, null);
     }
 
     Map<String, String> props = tsOp.getConf().getOpProps();
@@ -686,7 +686,7 @@ public final class GenMapRedUtils {
         partDir.add(p);
         try {
           if (part.getTable().isPartitioned()) {
-            partDesc.add(Utilities.getPartitionDesc(part));
+            partDesc.add(Utilities.getPartitionDesc(part, tblDesc));
           }
           else {
             partDesc.add(Utilities.getPartitionDescFromTableDesc(tblDesc, part, false));

http://git-wip-us.apache.org/repos/asf/hive/blob/7150f9c8/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java
index bf8ee75..d3a43df 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/PartitionDesc.java
@@ -82,8 +82,8 @@ public class PartitionDesc implements Serializable, Cloneable {
     setPartSpec(partSpec);
   }
 
-  public PartitionDesc(final Partition part) throws HiveException {
-    PartitionDescConstructorHelper(part, getTableDesc(part.getTable()), true);
+  public PartitionDesc(final Partition part, final TableDesc tableDesc) throws HiveException {
+    PartitionDescConstructorHelper(part, tableDesc, true);
     if (Utilities.isInputFileFormatSelfDescribing(this)) {
       // if IF is self describing no need to send column info per partition, since its not used anyway.
       Table tbl = part.getTable();
@@ -94,6 +94,10 @@ public class PartitionDesc implements Serializable, Cloneable {
     }
   }
 
+  public PartitionDesc(final Partition part) throws HiveException {
+    this(part, getTableDesc(part.getTable()));
+  }
+
   /**
    * @param part Partition
    * @param tblDesc Table Descriptor
@@ -229,10 +233,8 @@ public class PartitionDesc implements Serializable, Cloneable {
     }
   }
 
-  private static TableDesc getTableDesc(Table table) {
-    TableDesc tableDesc = Utilities.getTableDesc(table);
-    internProperties(tableDesc.getProperties());
-    return tableDesc;
+  public static TableDesc getTableDesc(Table table) {
+    return Utilities.getTableDesc(table);
   }
 
   private static void internProperties(Properties properties) {