[
https://issues.apache.org/jira/browse/HADOOP-11982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14559562#comment-14559562
]
Kannan Rajah commented on HADOOP-11982:
---------------------------------------
Does anyone have a comment on this issue? Is it OK to create a patch that
defaults to empty authority?
> Inconsistency in handling URI without authority
> -----------------------------------------------
>
> Key: HADOOP-11982
> URL: https://issues.apache.org/jira/browse/HADOOP-11982
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 2.7.0
> Reporter: Kannan Rajah
> Assignee: Kannan Rajah
>
> There are some inconsistencies coming from Hadoop class Path.java. This seems
> to be the behavior for a very long time. I am not sure about the implications
> of correcting it, so want to get some opinion.
> When you use makeQualified, a NULL authority is converted into empty
> authority. When authority is NULL, the toString will not contain the //
> before the actual absolute path. Otherwise it will not. There are ecosystem
> components that may or may not use makeQualified consistently. We have hit
> cases where the Path.toString() is used as key in hashmap. So lookups start
> failing when the entry has Path object constructed using makeQualified and
> lookup key does not.
> Proposal: Can we default to empty authority always when its NULL?
> -------------------------------------------------------------------------------------
> Examples
> ---------------
> Path p = new Path("hdfs:/a/b/c")
> p.toString() -> hdfs:/a/b/c -> There is a single slash
> p.makeQualified(fs);
> p/toString() -> hdfs:///a/b/c -> There are 3 slashes
> -------------------------------------------------------------------------------------
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)