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..e92cc57c67 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); @@ -276,7 +277,9 @@ public void externalTableWithPartitions() throws Throwable { .verifyResults(new String[] {"t2"}) .run("select place from t2") .verifyResults(new String[] {}) - .verifyReplTargetProperty(replicatedDbName); + .verifyReplTargetProperty(replicatedDbName) + .run("show partitions t2") + .verifyResults(new String[] {"country=india"});; // add new data externally, to a partition, but under the table level top directory Path partitionDir = new Path(externalTableLocation, "country=india"); @@ -299,6 +302,8 @@ public void externalTableWithPartitions() throws Throwable { .verifyResults(new String[] {}) .run("select place from t2 where country='australia'") .verifyResults(new String[] {}) + .run("show partitions t2") + .verifyResults(new String[] {"country=australia", "country=india"}) .verifyReplTargetProperty(replicatedDbName); Path customPartitionLocation = @@ -320,6 +325,8 @@ public void externalTableWithPartitions() throws Throwable { .run("use " + replicatedDbName) .run("select place from t2 where country='france'") .verifyResults(new String[] {}) + .run("show partitions t2") + .verifyResults(new String[] {"country=australia", "country=france", "country=india"}) .verifyReplTargetProperty(replicatedDbName); // change the location of the partition via alter command 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..ce8c9a51a9 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,7 +107,7 @@ 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()) { + if (conf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_METADATA_ONLY)) { return null; } else { return new PartitionIterable(db, tableSpec.tableHandle, null, conf.getIntVar(