You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Harsh J (Created) (JIRA)" <ji...@apache.org> on 2012/01/01 17:53:30 UTC

[jira] [Created] (HADOOP-7945) Document that Path objects do not support ":" in them.

Document that Path objects do not support ":" in them.
------------------------------------------------------

                 Key: HADOOP-7945
                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
             Project: Hadoop Common
          Issue Type: Improvement
    Affects Versions: 0.20.0
            Reporter: Harsh J
            Priority: Critical


Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Robert Joseph Evans (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Joseph Evans updated HADOOP-7945:
----------------------------------------

    Target Version/s: 2.0.0, 3.0.0  (was: 0.23.2)
    
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>         Attachments: HADOOP-7945.patch
>
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Niels Basjes (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178230#comment-13178230 ] 

Niels Basjes commented on HADOOP-7945:
--------------------------------------

Sorry, that was unreadable.

{code}
diff --git hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
index 81c79db..e135efb 100644
--- hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
+++ hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
@@ -90,7 +90,13 @@ public class Path implements Comparable {
     if( path.length() == 0 ) {
        throw new IllegalArgumentException(
            "Can not create a Path from an empty string");
-    }   
+    }
+    if( path.contains(":") ) {
+      throw new IllegalArgumentException(
+          "Can not create Path because Path is limited by URI semantics "+
+          "in the sense that one cannot create files whose names include "+
+          "characters such as \":\" etc.");
+    }
   }
   
   /** Construct a path from a String.  Path strings are URIs, but with

{code}

                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Niels Basjes (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178228#comment-13178228 ] 

Niels Basjes commented on HADOOP-7945:
--------------------------------------

Quick shot: Simply add another check to the already existing checkPathArg method in the Path class.
I.e. something like this (I never tested this code):

diff --git hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
index 81c79db..e135efb 100644
--- hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
+++ hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
@@ -90,7 +90,13 @@ public class Path implements Comparable {
     if( path.length() == 0 ) {
        throw new IllegalArgumentException(
            "Can not create a Path from an empty string");
-    }   
+    }
+    if( path.contains(":") ) {
+      throw new IllegalArgumentException(
+          "Can not create Path because Path is limited by URI semantics "+
+          "in the sense that one cannot create files whose names include "+
+          "characters such as \":\" etc.");
+    }
   }
   
   /** Construct a path from a String.  Path strings are URIs, but with



                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178208#comment-13178208 ] 

Harsh J commented on HADOOP-7945:
---------------------------------

I guess that could bring in compatibility issues. (People begin expecting that to fail, and at some point in future a bug fix like HADOOP-3257 regresses against that thought.) But otherwise, that idea is sound.

Do we emit no "Invalid char in path" form of messages today? If we do, then this is not a worry, we could inject looking for colon in that somehow.

Want to take a shot at it Niels? :)
                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Niels Basjes (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178206#comment-13178206 ] 

Niels Basjes commented on HADOOP-7945:
--------------------------------------

How about adding simple input check in Path that throws an exception with a descriptive message. That way the log files of the job/task contain the reason for the failure.
                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Niels Basjes (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niels Basjes updated HADOOP-7945:
---------------------------------

    Attachment: HADOOP-7945.patch

I added a unit test to force to trigger the error. It passes this and all existing unit tests.
So I think I found the right spot. 
Harsh, can you check it?
                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>         Attachments: HADOOP-7945.patch
>
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178239#comment-13178239 ] 

Harsh J commented on HADOOP-7945:
---------------------------------

Nope, given checkPathArg's positioning, that wouldn't work for path that are fully qualified (i.e. need a ":" as part of the {{file:///path/to/some/file/:/with/colon}}).
                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178186#comment-13178186 ] 

Harsh J commented on HADOOP-7945:
---------------------------------

We can document this in Path's javadocs, I think that should suffice. But brownie points if you can think of somewhere more visible and relevant :)
                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178704#comment-13178704 ] 

Harsh J commented on HADOOP-7945:
---------------------------------

Am thinking it might just be better to document this and add a test case (that'd fail the day its fixed).

Maybe this approach could cause incompatibility, as am not sure if there are ways to 'tweak' the Path into accepting ":" (escaped/encoded).

Another character that causes issue is a slash in the filename itself, even if escaped/encoded.
                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>         Attachments: HADOOP-7945.patch
>
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira