dataframe 转换为临时表,执行sparksql
val df = spark.read.json(Path) df.show()
//将dataframe 注册成为一张临时表 df.createOrReplaceTempView("persons") spark.sql("select * from persons where age > 20 ").show()
2024-03-07 11:14:14
dataframe 转换为临时表,执行sparksql
val df = spark.read.json(Path) df.show()
//将dataframe 注册成为一张临时表 df.createOrReplaceTempView("persons") spark.sql("select * from persons where age > 20 ").show()
下一篇:Python Day15