02_spark_sql

語言: CN / TW / HK
  1. json檔案

    M:192.168.249.70

    Worker:71/72   json檔案要分發到worker節點

image.png

image.png

{"name":"lili","salary":3000}

{"name":"andy","salary":4000}

{"name":"tom","salary":5000}

{"name":"pipi","salary":6000}

{"name":"alice","salary":7000}

{"name":"to","salary":7000}

2.跑資料

./bin/spark-shell   --master spark://192.168.249.70:7077

 var  df =  spark.read.json("examples/employ.json")

 df.show()image.png

3.

4.

5.

6.

7.