diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 38c0eed..12d51bf 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -2476,20 +2476,11 @@ private int add_partitions_pspec_core( throw new MetaException("Partition does not belong to target table " + dbName + "." + tblName + ": " + part); } - boolean shouldAdd = startAddPartition(ms, part, ifNotExists); - if (!shouldAdd) { - LOG.info("Not adding partition " + part + " as it already exists"); - continue; - } + // partition validation and checking whether it already exists in MS + // are taken care at MS layer. partFutures.add(threadPool.submit(new Callable() { @Override public Object call() throws Exception { boolean madeDir = createLocationForAddedPartition(table, part); - if (addedPartitions.put(new PartValEqWrapperLite(part), madeDir) != null) { - // Technically, for ifNotExists case, we could insert one and discard the other - // because the first one now "exists", but it seems better to report the problem - // upstream as such a command doesn't make sense. - throw new MetaException("Duplicate partitions in the list: " + part); - } initializeAddedPartition(table, part, madeDir); return part; }