hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ct...@apache.org
Subject hive git commit: HIVE-12365: Added resource path is sent to cluster as an empty string when externally removed (Chaoyu Tang, reviewed by Xuefu Zhang)
Date Wed, 11 Nov 2015 23:37:28 GMT
Repository: hive
Updated Branches:
  refs/heads/master 6310fc5c8 -> 206974a49


HIVE-12365: Added resource path is sent to cluster as an empty string when externally removed
(Chaoyu Tang, reviewed by Xuefu Zhang)


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

Branch: refs/heads/master
Commit: 206974a49d10a70ddabcdbebc710fca2dc7099fd
Parents: 6310fc5
Author: ctang <ctang.ma@gmail.com>
Authored: Wed Nov 11 18:37:19 2015 -0500
Committer: ctang <ctang.ma@gmail.com>
Committed: Wed Nov 11 18:37:19 2015 -0500

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/exec/Utilities.java   |  7 ++++-
 .../clientpositive/add_jar_with_file_removed.q  | 15 +++++++++++
 .../add_jar_with_file_removed.q.out             | 27 ++++++++++++++++++++
 3 files changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/206974a4/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
index 02adf0c..fc04f18 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
@@ -2150,7 +2150,12 @@ public final class Utilities {
       List<String> realFiles = new ArrayList<String>(files.size());
       for (String one : files) {
         try {
-          realFiles.add(realFile(one, conf));
+          String onefile = realFile(one, conf);
+          if (onefile != null) {
+            realFiles.add(realFile(one, conf));
+          } else {
+            LOG.warn("The file " + one + " does not exist.");
+          }
         } catch (IOException e) {
           throw new RuntimeException("Cannot validate file " + one + "due to exception: "
               + e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/hive/blob/206974a4/ql/src/test/queries/clientpositive/add_jar_with_file_removed.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/add_jar_with_file_removed.q b/ql/src/test/queries/clientpositive/add_jar_with_file_removed.q
new file mode 100644
index 0000000..95d7001
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/add_jar_with_file_removed.q
@@ -0,0 +1,15 @@
+!mkdir ${system:test.tmp.dir}/tmpjars;
+!touch ${system:test.tmp.dir}/tmpjars/added1.jar;
+!touch ${system:test.tmp.dir}/tmpjars/added2.jar;
+
+select count(key) from src;
+
+add jar ${system:test.tmp.dir}/tmpjars/added1.jar;
+add jar ${system:test.tmp.dir}/tmpjars/added2.jar;
+
+select count(key) from src;
+
+!rm ${system:test.tmp.dir}/tmpjars/added1.jar;
+
+select count(key) from src;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/206974a4/ql/src/test/results/clientpositive/add_jar_with_file_removed.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/add_jar_with_file_removed.q.out b/ql/src/test/results/clientpositive/add_jar_with_file_removed.q.out
new file mode 100644
index 0000000..cb495f4
--- /dev/null
+++ b/ql/src/test/results/clientpositive/add_jar_with_file_removed.q.out
@@ -0,0 +1,27 @@
+PREHOOK: query: select count(key) from src
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select count(key) from src
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+500
+PREHOOK: query: select count(key) from src
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select count(key) from src
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+500
+PREHOOK: query: select count(key) from src
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select count(key) from src
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+500


Mime
View raw message