hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cristina L. Abad (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-4329) DFSShell issues with directories with spaces in name
Date Wed, 10 Jul 2013 16:33:50 GMT

     [ https://issues.apache.org/jira/browse/HDFS-4329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Cristina L. Abad updated HDFS-4329:
-----------------------------------

    Attachment: 4329.trunk.patch

Attaching a patch for trunk. Some comments: (1) I did not do your suggested regexp change
since it would require me to strip the quotes in the result of matcher.group(1), so it reduces
some complexity in the regex and if statement but adds complexity to remove the quotes; (2)
the changes to CommandExecutor. java and testHDFSConf.xml were straightforward, but changing
PathData.java was more complicated since this class has a fix not available in 23 to deal
with Windows paths. Due to this fix, uriToString cannot be static and thus cannot be called
from expandAsGlob. I left expandAsGlob as is, as the getStringForChildPath change seems to
be enough to fix the whitespace encoding. The tests are passing. Should I change the 23 patch
to be more similar to the trunk patch?
                
> DFSShell issues with directories with spaces in name
> ----------------------------------------------------
>
>                 Key: HDFS-4329
>                 URL: https://issues.apache.org/jira/browse/HDFS-4329
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 2.0.2-alpha
>            Reporter: Andy Isaacson
>            Assignee: Cristina L. Abad
>         Attachments: 4329.branch-0.23.patch, 4329.trunk.patch
>
>
> This bug was discovered by Casey Ching.
> The command {{dfs -put /foo/hello.txt dir}} is supposed to create {{dir/hello.txt}} on
HDFS.  It doesn't work right if "dir" has a space in it:
> {code}
> [adi@haus01 ~]$ hdfs dfs -mkdir 'space cat'
> [adi@haus01 ~]$ hdfs dfs -put /etc/motd 'space cat'
> [adi@haus01 ~]$ hdfs dfs -cat 'space cat/motd'
> cat: `space cat/motd': No such file or directory
> [adi@haus01 ~]$ hdfs dfs -ls space\*
> Found 1 items
> -rw-r--r--   2 adi supergroup        251 2012-12-20 11:16 space%2520cat/motd
> [adi@haus01 ~]$ hdfs dfs -cat 'space%20cat/motd'
> Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-30-generic x86_64)
> ...
> {code}
> Note that the {{dfs -ls}} output wrongly encodes the wrongly encoded directory name,
turning {{%20}} into {{%2520}}.  It does the same thing with space:
> {code}
> [adi@haus01 ~]$ hdfs dfs -touchz 'space cat/foo'
> [adi@haus01 ~]$ hdfs dfs -ls 'space cat'
> Found 1 items
> -rw-r--r--   2 adi supergroup          0 2012-12-20 11:36 space%20cat/foo
> {code}

--
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

Mime
View raw message