dgadiraju
11/4/2017 - 2:49 PM

scala-spark-dataframes-sql-native.scala

// Register DF as temp table
ordersDF.registerTempTable("orders")

// Run query
sqlContext.sql("select * from orders where order_status = 'COMPLETE' limit 10").
  foreach(println)