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,7
insidetest.sh
file. givechmod +x
permissions inside grunt shell cansh ./test.sh
desired result. - suppose want include inside
pig
script , run usingpig -f
can use%declare basedir hadoop fs -ls /user/abc/fun/ | sort -k6,7 | tail -1
Comments
Post a Comment