Spark教程
1、将DataFrames注册成临时试图
scala> df.createOrReplaceTempView("people")
2、使用sql语句
scala> val sqlDF=spark.sql("select * from people") sqlDF: org.apache.spark.sql.DataFrame = [age: bigint, name: string] scala> sqlDF.show +---+------+ |age| name| +---+------+ | 30| Andy| | 19|Justin| | 21| tom| +---+------+
3、