[
https://issues.apache.org/jira/browse/HADOOP-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chuan Liu updated HADOOP-10272:
-------------------------------
Attachment: HADOOP-10272.patch
The root cause is that {{PathData.getStringForChildPath()}} will return a path
string that is encoded, i.e. ' ' will be encoded as '%20'. This path string
will later be used again in the Path constructor to pass to URI constructor,
and lead to double encoding. The wrongly encoded path will later lead to a copy
failure, because the wrongly encoded path is on longer the original user input
path. I suspect Unix/Linux also has this problem unless the Java URI
implementation is different on Unix/Linux platform. Attaching a patch that
address the issue.
> Hadoop 2 "-copyFromLocal" fail when source is a folder and there are spaces
> in the path
> ---------------------------------------------------------------------------------------
>
> Key: HADOOP-10272
> URL: https://issues.apache.org/jira/browse/HADOOP-10272
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 2.2.0
> Reporter: Shuaishuai Nie
> Assignee: Chuan Liu
> Attachments: HADOOP-10272.patch
>
>
> Repro steps:
> with folder structure like: /ab/c d/ef.txt
> hadoop command (hadoop fs -copyFromLocal /ab/ /) or (hadoop fs -copyFromLocal
> "/ab/c d/" /) fail with error:
> copyFromLocal: File file:/ab/c%20d/ef.txt does not exist
> However command (hadoop fs -copyFromLocal "/ab/c d/ef.txt" /) success.
> Seems like hadoop treat file and directory differently when "copyFromLocal".
> This only happens in Hadoop 2 and causing 2 Hive unit test failures
> (external_table_with_space_in_location_path.q and
> load_hdfs_file_with_space_in_the_name.q).
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)