diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index fce7fc32aa..52347c33b7 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -525,8 +525,8 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal + " Schemes of the file system which does not support atomic move (rename) can be specified here to \n " + " speed up the repl load operation. In file system like HDFS where move operation is atomic, this \n" + " optimization should not be enabled as it may lead to inconsistent data read for non acid tables."), - REPL_EXTERNAL_TABLE_BASE_DIR("hive.repl.replica.external.table.base.dir", "/", - "This is the base directory on the target/replica warehouse under which data for " + REPL_EXTERNAL_TABLE_BASE_DIR("hive.repl.replica.external.table.base.dir", null, + "This is the fully qualified base directory on the target/replica warehouse under which data for " + "external tables is stored. This is relative base path and hence prefixed to the source " + "external table path on target cluster."), REPL_INCLUDE_AUTHORIZATION_METADATA("hive.repl.include.authorization.metadata", false, diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java index f21fb7d3dd..ff513a4f6d 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java @@ -91,6 +91,7 @@ import java.io.InputStreamReader; import java.io.Serializable; import java.io.UnsupportedEncodingException; +import java.net.URI; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.Set; @@ -754,6 +755,12 @@ private void dumpTableListToDumpLocation(List tableList, Path dbRoot, St String baseDir = conf.get(HiveConf.ConfVars.REPL_EXTERNAL_TABLE_BASE_DIR.varname); // this is done to remove any scheme related information that will be present in the base path // specifically when we are replicating to cloud storage + URI basePathUri = (baseDir == null) ? null : new Path(baseDir).toUri(); + if (basePathUri == null || basePathUri.getScheme() == null || basePathUri.getAuthority() == null) { + throw new SemanticException( + String.format("Fully qualified path for 'hive.repl.replica.external.table.base.dir' ('%s') is required", + baseDir)); + } Path basePath = new Path(baseDir); for (Path sourcePath : sourceLocations) { Path targetPath = ReplExternalTables.externalTableDataPath(conf, basePath, sourcePath);