时间:2021-07-01 10:21:17 帮助过:3人阅读
{"name":"Michael"} {"name":"Andy", "age":30} {"name":"Justin", "age":19}
val path ="/root/temp/people.json"
val peopleDF = spark.read.json(path)
peopleDF.printSchema()
peopleDF.createOrReplaceTempView("people")
spark.sql("SELECT name FROM people WHERE age=19").show
【赵强老师】在Spark SQL中读取JSON文件
标签:efault 引擎 并且 对象 数据 查询 注意 分布式 pat