Get a few lines of HDFS data

前端 未结 9 1820
一整个雨季
一整个雨季 2021-02-04 02:17

I am having a 2 GB data in my HDFS.

Is it possible to get that data randomly. Like we do in the Unix command line

cat iris2.cs         


        
9条回答
  •  攒了一身酷
    2021-02-04 02:50

    I was using tail and cat for an avro file on HDFS cluster, but the result was not getting printed in correct encoding. I tried this and worked well for me.

    hdfs dfs -text hdfs:///part-m-00000.avro | head -n 1
    

    Change 1 to higher integer to print more samples from avro file.

提交回复
热议问题