mtth / hdfs

API and command line interface for HDFS
https://hdfscli.readthedocs.io
MIT License
268 stars 100 forks source link

Add glob support #105

Open FmLiu opened 6 years ago

FmLiu commented 6 years ago

As title said, I didn't find any method in Client could support a path like '/user/*/{1,2,3}'.

If I wanna to delete some dir like /user/*/{1,2,3}.

hadoop fs -rm -r /user/*/{1,2,3} 

Above shell cmd can do it easily, but I can't find any way to do this in python api such easily.

I want to know that if any method in Client or other class can help me in above situation.

mtth commented 5 years ago

HdfsCLI doesn't have any logic to handle * or brace expansion currently. This could be a good feature to add. I'm actually surprised the WebHDFS API itself doesn't support globbing if the hadoop CLI does; it seems valuable enough to belong there rather than in client code.