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

ASF GitHub Bot commented on FLINK-1270:
---------------------------------------

Github user zentol commented on the pull request:

    https://github.com/apache/incubator-flink/pull/224#issuecomment-64092085
  
    ```
    Path relativePath = new Path("wordcount.py");
    Path absolutePath = 
relativePath.makeQualified(relativePath.getFileSystem());
    ```
    This code fails since its not an absolute path. I think it absolutely 
should work since relative paths are so common. without *some* change, 
supporting relative paths is always a clunky affair since you have to check for 
scheme's yourself before using `getAbsolutePath()`.
    
    Regarding normalization: We could move `uri = new URI("file", null, new 
File(uri.getPath()).getAbsolutePath(), null);` into the URISyntaxException 
block. It will only be executed if the current code fails anyway, and as such 
shouldn't affect working code.
    
    Regarding forgotten slashes:  If you go through the Path class the scheme 
will be correctly identified no matter how many slashes are behind `file:`, and 
if there are none it throws an exception in the constructor. The only 
problematic case i can think of is : `FileSystem.get(new 
URI("file:world.txt"))`. In this case, getPath would return null. But since the 
scheme is correctly identified as `file` the code in questions will not be 
executed, and as such has no bearing on this issue.



> FileSystem.get() doesn't support relative paths
> -----------------------------------------------
>
>                 Key: FLINK-1270
>                 URL: https://issues.apache.org/jira/browse/FLINK-1270
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to