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

Chris Nauroth commented on HDFS-4632:
-------------------------------------

This problem is visible by running {{TestGlobPaths#pTestEscape}} on Windows.  
On Windows, the backslash will get converted to forward slash before 
{{GlobExpander}} interprets it.  This problem was not caught on branch-1-win, 
because the test is commented out on that branch with a comment pointing to 
HADOOP-1995.  That jira contains a lot of discussion on this topic, so it would 
be good for anyone participating on this jira to review that one first.

This is particularly awkward, because {{FileSystem#globStatus}} is a public API 
accepting a {{Path}}.  We can't change the normalization behavior of {{Path}} 
without breaking a lot of things.  We can't change the API to accept a 
different kind of object (i.e. a new RawGlobPath class) without breaking 
backwards compatibility.  I can think of a few options:

# Accept this as a known limitation on Windows and skip running the failing 
test on Windows.  This is the conclusion of HADOOP-1995, so refer to that jira 
for the full justification.  This may in fact be the only viable short-term 
solution.
# Change {{Path}} to maintain a separate raw, unescaped copy of the path at 
construction time.  Change {{FileSystem#globStatus}} to use this raw copy of 
the path and allow all other clients of {{Path}} to continue using the escaped 
version.  The negative consequence is that this would effectively double the 
memory consumption of {{Path}} instances.
# Add a new overload of {{FileSystem#globStatus}} that accepts something 
different from {{Path}}.  Deprecate the old one and gradually phase it out.

                
> globStatus using backslash for escaping does not work on Windows
> ----------------------------------------------------------------
>
>                 Key: HDFS-4632
>                 URL: https://issues.apache.org/jira/browse/HDFS-4632
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>
> {{Path}} normalizes backslashes to forward slashes on Windows.  Later, when 
> passed to {{FileSystem#globStatus}}, the path is no longer treated as an 
> escape sequence.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to