hdfs icon indicating copy to clipboard operation
hdfs copied to clipboard

Add glob support

Open FmLiu opened this issue 7 years ago • 1 comments

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.

FmLiu avatar Aug 31 '18 09:08 FmLiu

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.

mtth avatar Nov 20 '18 10:11 mtth