You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by ge...@apache.org on 2017/05/30 15:06:07 UTC

oozie git commit: OOZIE-2387 Oozie is Unable to handle Spaces in file/archive tag. (asasvari via gezapeti)

Repository: oozie
Updated Branches:
  refs/heads/master 6121dc0cd -> 83d4ddf45


OOZIE-2387 Oozie is Unable to handle Spaces in file/archive tag. (asasvari via gezapeti)


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

Branch: refs/heads/master
Commit: 83d4ddf45aa16649bd9fae367fa915379d5781cd
Parents: 6121dc0
Author: Gezapeti Cseh <ge...@gmail.com>
Authored: Tue May 30 17:06:00 2017 +0200
Committer: Gezapeti Cseh <ge...@gmail.com>
Committed: Tue May 30 17:06:00 2017 +0200

----------------------------------------------------------------------
 .../org/apache/oozie/action/hadoop/JavaActionExecutor.java  | 9 +++++++--
 .../apache/oozie/action/hadoop/TestJavaActionExecutor.java  | 5 +++++
 release-log.txt                                             | 1 +
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/83d4ddf4/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
index f4c1127..56eb035 100644
--- a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
+++ b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
@@ -442,7 +442,7 @@ public class JavaActionExecutor extends ActionExecutor {
 
         URI uri = null;
         try {
-            uri = new URI(filePath);
+            uri = new URI(getTrimmedEncodedPath(filePath));
             URI baseUri = appPath.toUri();
             if (uri.getScheme() == null) {
                 String resolvedPath = uri.getPath();
@@ -682,7 +682,7 @@ public class JavaActionExecutor extends ActionExecutor {
             if (eProp.getName().equals("file")) {
                 String[] filePaths = eProp.getTextTrim().split(",");
                 for (String path : filePaths) {
-                    addToCache(conf, appPath, path.trim(), false);
+                    addToCache(conf, appPath, path, false);
                 }
             }
             else if (eProp.getName().equals("archive")) {
@@ -696,6 +696,11 @@ public class JavaActionExecutor extends ActionExecutor {
         addAllShareLibs(appPath, conf, context, actionXml);
     }
 
+    @VisibleForTesting
+    protected static String getTrimmedEncodedPath(String path) {
+        return path.trim().replace(" ", "%20");
+    }
+
     // Adds action specific share libs and common share libs
     private void addAllShareLibs(Path appPath, Configuration conf, Context context, Element actionXml)
             throws ActionExecutorException {

http://git-wip-us.apache.org/repos/asf/oozie/blob/83d4ddf4/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java b/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
index 48809ce..97cd469 100644
--- a/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
+++ b/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
@@ -2252,4 +2252,9 @@ public class TestJavaActionExecutor extends ActionExecutorTestCase {
 
         assertEquals(2048, JavaActionExecutor.getMaxOutputData(conf));
     }
+
+    public void testFileWithSpaces() throws Exception {
+        String actPath = JavaActionExecutor.getTrimmedEncodedPath("/user/map dev/test-case/shell/script/shell 1.sh");
+        assertEquals("/user/map%20dev/test-case/shell/script/shell%201.sh", actPath);
+    }
 }

http://git-wip-us.apache.org/repos/asf/oozie/blob/83d4ddf4/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 983f646..7c7af8c 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 4.4.0 release (trunk - unreleased)
 
+OOZIE-2387 Oozie is Unable to handle Spaces in file/archive tag. (asasvari via gezapeti)
 OOZIE-2917 duplicate declaration warning for io.dropwizard.metrics:metrics-core (Artem Ervits via gezapeti)
 OOZIE-1770 Create Oozie Application Master for YARN (pbacsko, rkanter, gezapeti)
 OOZIE-2316 Drop support for Hadoop 1 and 0.23 (asasvari)