标签:hdf str text src medium Parquet dfs ext file
1、进入spark-shell窗口
2、
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
3、
val parquetFile = sqlContext.parquetFile("hdfs://cdp/user/az-user/sparkStreamingKafka2HdfsData/part-00000-ff60a7d3-bf91-4717-bd0b-6731a66b9904-c000.snappy.parquet")
hdfs://cdp是defaultFS,也可以不写,如下:
val parquetFile2 = sqlContext.parquetFile("/user/az-user/sparkStreamingKafka2HdfsData/part-00000-ff60a7d3-bf91-4717-bd0b-6731a66b9904-c000.snappy.parquet")
4、
parquetFile.take(30).foreach(println)
标签:hdf str text src medium Parquet dfs ext file
原文地址:https://www.cnblogs.com/mylittlecabin/p/11562922.html