hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject hive git commit: HIVE-13057: Remove duplicate copies of TableDesc property values in PartitionDesc (Mohit via Xuefu)
Date Fri, 19 Feb 2016 22:59:32 GMT
Repository: hive
Updated Branches:
  refs/heads/master 487cf1595 -> cc8cec235


HIVE-13057: Remove duplicate copies of TableDesc property values in PartitionDesc (Mohit via
Xuefu)


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

Branch: refs/heads/master
Commit: cc8cec2355f70cc066bb877dd700ac15f7a8e763
Parents: 487cf15
Author: Xuefu Zhang <xzhang@Cloudera.com>
Authored: Fri Feb 19 14:59:21 2016 -0800
Committer: Xuefu Zhang <xzhang@Cloudera.com>
Committed: Fri Feb 19 14:59:21 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/plan/PartitionDesc.java  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/cc8cec23/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 b032349..4d627ef 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
@@ -35,6 +35,7 @@ import org.apache.hadoop.hive.ql.io.HiveFileFormatUtils;
 import org.apache.hadoop.hive.ql.io.HiveOutputFormat;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
 import org.apache.hadoop.hive.ql.metadata.Partition;
+import org.apache.hadoop.hive.ql.metadata.Table;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.Deserializer;
 import org.apache.hadoop.hive.serde2.SerDeUtils;
@@ -83,7 +84,7 @@ public class PartitionDesc implements Serializable, Cloneable {
   }
 
   public PartitionDesc(final Partition part) throws HiveException {
-    PartitionDescConstructorHelper(part, Utilities.getTableDesc(part.getTable()), true);
+    PartitionDescConstructorHelper(part, getTableDesc(part.getTable()), true);
     setProperties(part.getMetadataFromPartitionSchema());
   }
 
@@ -209,7 +210,17 @@ public class PartitionDesc implements Serializable, Cloneable {
   }
 
   public void setProperties(final Properties properties) {
+    internProperties(properties);
     this.properties = properties;
+  }
+
+  private static TableDesc getTableDesc(Table table) {
+    TableDesc tableDesc = Utilities.getTableDesc(table);
+    internProperties(tableDesc.getProperties());
+    return tableDesc;
+  }
+
+  private static void internProperties(Properties properties) {
     for (Enumeration<?> keys =  properties.propertyNames(); keys.hasMoreElements();)
{
       String key = (String) keys.nextElement();
       String oldValue = properties.getProperty(key);


Mime
View raw message