Spark实验五
作者:互联网
json数据
{ "id":1 ,"name":"Ella","age":36} { "id":2,"name":"Bob","age":29 } { "id":3 ,"name":"Jack","age":29} { "id":4 ,"name":"Jim","age":28} { "id":4 ,"name":"Jim","age":28} { "id":5 ,"name":"Damon" } { "id":5 ,"name":"Damon" }
命令行:
cd /usr/local/spark bin/spark-shell import org.apache.spark.sql.SparkSession val spark=SparkSession.builder().getOrCreate() import spark.implicits._ val df = spark.read.json("file:///usr/local/spark/employee.json")
标签:name,age,Jim,id,json,实验,spark,Spark 来源: https://www.cnblogs.com/a155-/p/14292364.html