diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTables.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTables.java index 740f229921..6a9cf1e4af 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTables.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTables.java @@ -166,7 +166,8 @@ public void externalTableReplicationWithDefaultPaths() throws Throwable { .run("select country from t2 where country = 'us'") .verifyResult("us") .run("select country from t2 where country = 'france'") - .verifyResult("france"); + .verifyResult("france") + .run("show partitions t2").verifyResults(new String[] {"country=france", "country=india", "country=us"}); // Ckpt should be set on bootstrapped db. replica.verifyIfCkptSet(replicatedDbName, tuple.dumpLocation); diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTablesMetaDataOnly.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTablesMetaDataOnly.java index e9d0162cd0..a5b9e51eba 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTablesMetaDataOnly.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTablesMetaDataOnly.java @@ -164,7 +164,8 @@ public void externalTableReplicationWithDefaultPaths() throws Throwable { .run("select country from t2 where country = 'us'") .verifyResult(null) .run("select country from t2 where country = 'france'") - .verifyResult(null); + .verifyResult(null) + .run("show partitions t2").verifyResults(new String[] {"country=france", "country=india", "country=us"}); // Ckpt should be set on bootstrapped db. replica.verifyIfCkptSet(replicatedDbName, tuple.dumpLocation); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/TableExport.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/TableExport.java index 97a1dd31a7..37b7969508 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/TableExport.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/TableExport.java @@ -107,12 +107,8 @@ private PartitionIterable getPartitions() throws SemanticException { if (tableSpec != null && tableSpec.tableHandle != null && tableSpec.tableHandle.isPartitioned()) { if (tableSpec.specType == TableSpec.SpecType.TABLE_ONLY) { // TABLE-ONLY, fetch partitions if regular export, don't if metadata-only - if (replicationSpec.isMetadataOnly()) { - return null; - } else { - return new PartitionIterable(db, tableSpec.tableHandle, null, conf.getIntVar( - HiveConf.ConfVars.METASTORE_BATCH_RETRIEVE_MAX), true); - } + return new PartitionIterable(db, tableSpec.tableHandle, null, conf.getIntVar( + HiveConf.ConfVars.METASTORE_BATCH_RETRIEVE_MAX), true); } else { // PARTITIONS specified - partitions inside tableSpec return new PartitionIterable(tableSpec.partitions);