apache pig - Date wise listing of hadoop file in pig -
i did :
hadoop dfs -ls /user/abc/fun/
and worked fine , listed files in increasing order alphabetically. want listing of files according date in increasing order i.e. latest date file placed @ bottom
something this:
hadoop dfs -ls ltrh /user/abc/fun/
it didn't worked read pig's wiki not valid fsshell command. please suggest how desired result. appreciated.thanks!!!
there couple of ways
- if want inside pig shell , not script save following command hadoop fs -ls /user/abc/fun/ | sort -k6,7insidetest.shfile. givechmod +xpermissions inside grunt shell cansh ./test.shdesired result.
- suppose want include inside pigscript , run usingpig -fcan use%declare basedir hadoop fs -ls /user/abc/fun/ | sort -k6,7 | tail -1
Comments
Post a Comment