Repository: hive Updated Branches: refs/heads/branch-1 e4937c033 -> efec8cc83
HIVE-11990 : Loading data inpath from a temporary table dir fails on Windows (Hari Subramaniyan, reviewed by Jason Dere) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/efec8cc8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/efec8cc8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/efec8cc8 Branch: refs/heads/branch-1 Commit: efec8cc833dcba9b6cdf7985da9848c3c4ecac7a Parents: e4937c0 Author: Hari Subramaniyan <[email protected]> Authored: Fri Oct 2 11:11:46 2015 -0700 Committer: Hari Subramaniyan <[email protected]> Committed: Fri Oct 2 11:12:29 2015 -0700 ---------------------------------------------------------------------- .../hadoop/hive/ql/parse/LoadSemanticAnalyzer.java | 12 ------------ .../queries/clientpositive/load_non_hdfs_path.q | 6 ++++++ .../results/clientpositive/load_non_hdfs_path.q.out | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/efec8cc8/ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java index 0051dae..aacfa92 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java @@ -159,18 +159,6 @@ public class LoadSemanticAnalyzer extends BaseSemanticAnalyzer { throw new SemanticException(ErrorMsg.INVALID_PATH.getMsg(ast), e); } - // only in 'local' mode do we copy stuff from one place to another. - // reject different scheme/authority in other cases. - if (!isLocal - && (!StringUtils.equals(fromURI.getScheme(), toURI.getScheme()) || !StringUtils - .equals(fromURI.getAuthority(), toURI.getAuthority()))) { - String reason = "Move from: " + fromURI.toString() + " to: " - + toURI.toString() + " is not valid. " - + "Please check that values for params \"default.fs.name\" and " - + "\"hive.metastore.warehouse.dir\" do not conflict."; - throw new SemanticException(ErrorMsg.ILLEGAL_PATH.getMsg(ast, reason)); - } - return srcs; } http://git-wip-us.apache.org/repos/asf/hive/blob/efec8cc8/ql/src/test/queries/clientpositive/load_non_hdfs_path.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/load_non_hdfs_path.q b/ql/src/test/queries/clientpositive/load_non_hdfs_path.q new file mode 100644 index 0000000..824ce69 --- /dev/null +++ b/ql/src/test/queries/clientpositive/load_non_hdfs_path.q @@ -0,0 +1,6 @@ +dfs ${system:test.dfs.mkdir} ${system:test.tmp.dir}/non_hdfs_path; +dfs -touchz ${system:test.tmp.dir}/non_hdfs_path/1.txt; +dfs -chmod 555 ${system:test.tmp.dir}/non_hdfs_path/1.txt; + +create table t1(i int); +load data inpath 'pfile:${system:test.tmp.dir}/non_hdfs_path/' overwrite into table t1; http://git-wip-us.apache.org/repos/asf/hive/blob/efec8cc8/ql/src/test/results/clientpositive/load_non_hdfs_path.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/load_non_hdfs_path.q.out b/ql/src/test/results/clientpositive/load_non_hdfs_path.q.out new file mode 100644 index 0000000..31c40d8 --- /dev/null +++ b/ql/src/test/results/clientpositive/load_non_hdfs_path.q.out @@ -0,0 +1,16 @@ +PREHOOK: query: create table t1(i int) +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@t1 +POSTHOOK: query: create table t1(i int) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@t1 +#### A masked pattern was here #### +PREHOOK: type: LOAD +#### A masked pattern was here #### +PREHOOK: Output: default@t1 +#### A masked pattern was here #### +POSTHOOK: type: LOAD +#### A masked pattern was here #### +POSTHOOK: Output: default@t1
