Repository: hive
Updated Branches:
  refs/heads/master 5449dffc2 -> b43b4d2a2


HIVE-20400 : create table should always use a fully qualified path to avoid 
potential FS ambiguity (Sergey Shelukhin, reviewed by Alan Gates)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b43b4d2a
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b43b4d2a
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b43b4d2a

Branch: refs/heads/master
Commit: b43b4d2a261881d6ccdd97387359fc7658c656d5
Parents: 5449dff
Author: sergey <ser...@apache.org>
Authored: Fri Aug 17 14:50:01 2018 -0700
Committer: sergey <ser...@apache.org>
Committed: Fri Aug 17 14:50:30 2018 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java     | 7 +++++--
 .../src/test/org/apache/hive/service/cli/CLIServiceTest.java  | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b43b4d2a/ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java
index 0a535d1..dd75b32 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/EximUtil.java
@@ -236,8 +236,11 @@ public class EximUtil {
         }
         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);

http://git-wip-us.apache.org/repos/asf/hive/blob/b43b4d2a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
----------------------------------------------------------------------
diff --git a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java 
b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
index 48afa06..fa61d3c 100644
--- a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
+++ b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
@@ -240,6 +240,7 @@ public abstract class CLIServiceTest {
      * 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 @@ public abstract class CLIServiceTest {
     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

Reply via email to