hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hemanthboyina (Jira)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-14762) "Path(Path/String parent, String child)" will fail when "child" contains ":"
Date Fri, 23 Aug 2019 19:56:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-14762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16914575#comment-16914575
] 

hemanthboyina commented on HDFS-14762:
--------------------------------------

{code:java}
    // parse uri scheme, if any
    int colon = pathString.indexOf(':');
    int slash = pathString.indexOf('/');
    if ((colon != -1) &&
        ((slash == -1) || (colon < slash))) {     // has a scheme
      scheme = pathString.substring(0, colon);
      start = colon+1;
    }    
    // parse uri authority, if any
    // uri path is the rest of the string -- query & fragment not supported
    String path = pathString.substring(start, pathString.length());   
    initialize(scheme, authority, path, null); {code}

a colon with slash as next character *:/*  will be success , but colon without a slash will
fail *:*

from the initilaize (URI will be constructed here)
a:/b    if the scheme was not null and  the path starts with slash - Success
a:b      but if the scheme was not null and path starts without slash - Fails
[~ayushtkn]  any suggestions for implementing a:b success ?

> "Path(Path/String parent, String child)" will fail when "child" contains ":"
> ----------------------------------------------------------------------------
>
>                 Key: HDFS-14762
>                 URL: https://issues.apache.org/jira/browse/HDFS-14762
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Shixiong Zhu
>            Assignee: hemanthboyina
>            Priority: Major
>
> When the "child" parameter contains ":", "Path(Path/String parent, String child)" will
throw the following exception:
> {code}
> java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute
URI: ...
> {code}
> Not sure if this is a legit bug. But the following places will hit this error when seeing
a Path with a file name containing ":":
> https://github.com/apache/hadoop/blob/f9029c4070e8eb046b403f5cb6d0a132c5d58448/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java#L101
> https://github.com/apache/hadoop/blob/f9029c4070e8eb046b403f5cb6d0a132c5d58448/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Globber.java#L270



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message