sparkSQL获取DataFrame的几种方式
1. on a specific DataFrame.
import org.apache.spark.sql.Column
df("columnName")
2. A generic column no yet associated with a DataFrame.
import org.apache.spark.sql.functions._
col("columnName")
3. Scala short hand for a named column.
import spark.implicits._ df.select($"name")
4. Scala short hand for a named column.
import spark.implicits._ df.select('name)