SQLContext里的sql函数允许应用程序执行SQL查询,并作为一个DataFrame返回结果。
val sqlContext = ... // An existing SQLContext val df = sqlContext.sql("SELECT * FROM table")