例如,我想在递归时间戳目录中递归输出大小为0的文件路径,如下hdfs://<DIRECTORY>/<TIMESTAMP>
// <DIRECTORY>/<TIMESTAMP1>
-rw-r--r-- 3 USER supergroup 0 2022-10-23 21:52 hdfs://<DIRECTORY>/20221015/part-03767.pb.zstd
-rw-r--r-- 3 USER supergroup 71667 2022-10-23 21:52 hdfs://<DIRECTORY>/20221015/part-03768.pb.zstd
-rw-r--r-- 3 USER supergroup 94330 2022-10-23 21:52 hdfs://<DIRECTORY>/20221015/part-03769.pb.zstd
// <DIRECTORY>/<TIMESTAMP2>
-rw-r--r-- 3 USER supergroup 14756 2022-10-23 21:52 hdfs://<DIRECTORY>/20221016/part-03770.pb.zstd
-rw-r--r-- 3 USER supergroup 0 2022-10-23 21:52 hdfs://<DIRECTORY>/20221016/part-03771.pb.zstd
<TIMESTAMP>
从20220501
到20221231
// output
-rw-r--r-- 3 USER supergroup 0 2022-10-23 21:52 hdfs://<DIRECTORY>/20221015/part-03767.pb.zstd
-rw-r--r-- 3 USER supergroup 0 2022-10-23 21:52 hdfs://<DIRECTORY>/20221016/part-03771.pb.zstd
Thanks in advance .
要递归地获取文件,
hadoop fs -ls -R
把这个和你之前的问题结合起来