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

Prashant Kommireddi commented on PIG-3183:
------------------------------------------

Thanks for the review, Jonathan. I have a slightly different opinion on this, 
here is why:

1. Users in the past who used "rm *" would know it does not work [category 1]
2. These users could probably have a hack in place right now to solve this, OR 
would be completely avoiding a glob delete (as it doesn't work).
3. For new users, this behavior is consistent with Hadoop in which case it 
should be ok [category 2]
4. There has been no documentation around this, which means Pig users either 
fall in category 1 or 2. It would not make a lot of sense for users to have a 
"rm *" in their scripts as it never worked.
5. Also, current behavior (rm or ls) is different from the way we accept globs 
in Loading files. There seems to be an inherent inconsistency in what users 
should expect in saying "A = load 'input/*'" vs "ls input/*".

The reason I would prefer this being the default behavior is for above reasons, 
in addition to a lot of users not discovering it at all when its a config 
property. 

Let me know what you think? Others, please let us know what you think too.
                
> rm or rmf commands should respect globbing/regex of path
> --------------------------------------------------------
>
>                 Key: PIG-3183
>                 URL: https://issues.apache.org/jira/browse/PIG-3183
>             Project: Pig
>          Issue Type: Improvement
>          Components: grunt
>    Affects Versions: 0.10.0
>            Reporter: Prashant Kommireddi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.12
>
>         Attachments: PIG-3183.patch
>
>
> Hadoop fs commands support globbing during deleting files/dirs. Pig is not 
> consistent with this behavior and seems like we could change rm/rmf commands 
> to do the same.
> For eg:
> {code}
> localhost:pig pkommireddi$ ls -ld out*
> drwxr-xr-x  12 pkommireddi  SF\domain users  408 Feb 13 01:09 out
> drwxr-xr-x   2 pkommireddi  SF\domain users   68 Feb 13 01:16 out1
> drwxr-xr-x   2 pkommireddi  SF\domain users   68 Feb 13 01:16 out2
> localhost:pig pkommireddi$ bin/pig -x local
> grunt> rmf out*
> grunt> quit
> localhost:pig pkommireddi$ ls -ld out*
> drwxr-xr-x  12 pkommireddi  SF\domain users  408 Feb 13 01:09 out
> drwxr-xr-x   2 pkommireddi  SF\domain users   68 Feb 13 01:16 out1
> drwxr-xr-x   2 pkommireddi  SF\domain users   68 Feb 13 01:16 out2
> {code}
> Ideally, the user would expect "rmf out*" to delete all of the above dirs.

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