diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 38c0eed..5873210 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -2476,20 +2476,10 @@ 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; - } 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); - } + addedPartitions.put(new PartValEqWrapperLite(part), madeDir); initializeAddedPartition(table, part, madeDir); return part; }