You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Jeff Hodges (JIRA)" <ji...@apache.org> on 2012/06/22 20:40:43 UTC

[jira] [Created] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Jeff Hodges created HDFS-3557:
---------------------------------

             Summary: provide means of escaping special characters to `hadoop fs` command
                 Key: HDFS-3557
                 URL: https://issues.apache.org/jira/browse/HDFS-3557
             Project: Hadoop HDFS
          Issue Type: Improvement
            Reporter: Jeff Hodges
            Priority: Minor


When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.

But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").

Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400819#comment-13400819 ] 

Daryn Sharp commented on HDFS-3557:
-----------------------------------

Erg, forgot the escapes:
{code}hadoop -ls '/foobar/\{18,19,20\}'{code}
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405141#comment-13405141 ] 

Daryn Sharp commented on HDFS-3557:
-----------------------------------

Would you please fill in the affected versions?
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Jeff Hodges (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Hodges updated HDFS-3557:
------------------------------

    Affects Version/s: 0.20.2
    
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 0.20.2
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400816#comment-13400816 ] 

Daryn Sharp commented on HDFS-3557:
-----------------------------------

Try placing quotes around the paths, otherwise your unix shell is expanding the glob instead of hadoop expanding the glob.  Ie.
{code}hadoop -ls '/foobar/{18,19,20}'{code}
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Jeff Hodges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406215#comment-13406215 ] 

Jeff Hodges commented on HDFS-3557:
-----------------------------------

Done.
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 0.20.2
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Jeff Hodges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13404158#comment-13404158 ] 

Jeff Hodges commented on HDFS-3557:
-----------------------------------

Annnd, the slashes in the first got removed, but, I assure you, were there like your comment. I give up on trying to get jira to take this the way I mean it.
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Jeff Hodges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13404155#comment-13404155 ] 

Jeff Hodges commented on HDFS-3557:
-----------------------------------

These were all previously tried and failed.

$ hdfs -ls '/NOPE_\{INPUT\}'
ls: Illegal file pattern: Expecting set closure character or end of range, or } for glob {INPUT at 6
$ hdfs -ls '/NOPE_{INPUT}'
ls: Cannot access /user/jhodges/NOPE_{INPUT}: No such file or directory.
$ hdfs -ls /NOPE_\{INPUT\}
ls: Cannot access /user/jhodges/NOPE_{INPUT}: No such file or directory.

Proof of existence:
$ hdfs -ls /user/jhodges | grep NOPE
drwxr-xr-x   - jhodges supergroup          0 2012-06-29 19:47 /user/jhodges/NOPE_{INPUT}

                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409520#comment-13409520 ] 

Daryn Sharp commented on HDFS-3557:
-----------------------------------

Yes, it is a pain to get backslashes through...  20.2 is pretty old.  I don't think 20.5 has the problem so you may want to consider upgrading to the latest 20, or better yet, 1.x.
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 0.20.2
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Jeff Hodges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13404157#comment-13404157 ] 

Jeff Hodges commented on HDFS-3557:
-----------------------------------

Sigh, I thought I had removed all the user specific stuff. Not able to edit it, so I'll just repost with it.

$ hdfs -ls '/user/jhodges/NOPE_\{INPUT\}'
ls: Illegal file pattern: Expecting set closure character or end of range, or } for glob {INPUT at 6
$ hdfs -ls '/user/jhodges/NOPE_{INPUT}'
ls: Cannot access /user/jhodges/NOPE_{INPUT}: No such file or directory.
$ hdfs -ls /user/jhodges/NOPE_\{INPUT\}
ls: Cannot access /user/jhodges/NOPE_{INPUT}: No such file or directory.

Proof of existence:

$ hdfs -ls /user/jhodges | grep NOPE
drwxr-xr-x   - jhodges supergroup          0 2012-06-29 19:47 /user/jhodges/NOPE_{INPUT}
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Jeff Hodges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400774#comment-13400774 ] 

Jeff Hodges commented on HDFS-3557:
-----------------------------------

The version is cdhu3.2 and the commands are (where /foobar/{18,19,20} is the name of a real directory created by a mapreduce job, and not multiple ones)

{code}
hadoop -ls /foobar/{18,19,20}
hadoop -mv /foobar/{18,19,20} /foobar/new
hadoop -rmr /foobar/{18,19,20}
{code}

All fail with errors that say the directories don't exist or that selecting multiple directories does not work.
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3557) provide means of escaping special characters to `hadoop fs` command

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399523#comment-13399523 ] 

Daryn Sharp commented on HDFS-3557:
-----------------------------------

Would you please fill in the affected version(s), and supply the exact cmdline you are trying to run?
                
> provide means of escaping special characters to `hadoop fs` command
> -------------------------------------------------------------------
>
>                 Key: HDFS-3557
>                 URL: https://issues.apache.org/jira/browse/HDFS-3557
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>
> When running an investigative job, I used a date parameter that selected multiple directories for the input (e.g. "my_data/2012/06/{18,19,20}"). It used this same date parameter when creating the output directory.
> But `hadoop fs` was unable to ls, getmerge, or rmr it until I used the regex operator "?" and mv to change the name (that is, `-mv output/2012/06/?18,19,20? foobar").
> Shells and filesystems for other systems provide a means of escaping "special characters" generically, but there seems to be no such means in HDFS/`hadoop fs`. Providing one would be a great way to make accessing HDFS more robust.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira