diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java index 0a535d15c1..dd75b326f5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java @@ -236,8 +236,11 @@ public static String relativeToAbsolutePath(HiveConf conf, String location) } return uri.toString(); } else { - // no-op for non-test mode for now - return location; + Path path = new Path(location); + if (path.isAbsolute()) { + return location; + } + return path.getFileSystem(conf).makeQualified(path).toString(); } } catch (IOException e) { throw new SemanticException(ErrorMsg.IO_ERROR.getMsg() + ": " + e.getMessage(), e); diff --git service/src/test/org/apache/hive/service/cli/CLIServiceTest.java service/src/test/org/apache/hive/service/cli/CLIServiceTest.java index 48afa06c7c..fa61d3c653 100644 --- service/src/test/org/apache/hive/service/cli/CLIServiceTest.java +++ service/src/test/org/apache/hive/service/cli/CLIServiceTest.java @@ -240,6 +240,7 @@ public void testExecuteStatementAsync() throws Exception { * to give a runtime time error. * Also check that the sqlState and errorCode should be set */ + // TODO: this is brittle.. anything that touches this path during compile will break this test queryString = "CREATE TABLE NON_EXISTING_TAB (ID STRING) location 'invalid://localhost:10000/a/b/c'"; opStatus = runAsyncAndWait(sessionHandle, queryString, confOverlay, OperationState.ERROR, longPollingTimeout); // sqlState, errorCode should be set @@ -535,7 +536,7 @@ private OperationStatus waitForAsyncQuery(OperationHandle opHandle, long longPollingTimeDelta; OperationStatus opStatus = null; OperationState state = null; - int count = 0; + int count = 0; long start = System.currentTimeMillis(); while (true) { // Break if iteration times out