Pacific-Design.com

    
Home Index

1. Spark

2. TempTable

Spark / TempTable /

Saving DataFrame as Temporary Table


scala> csc.setKeyspace("engine")

scala> val df1 = csc.sql("select domain, count(*) total from engine.links where url like '%health%' group by domain order by total desc").toDF()
df1: org.apache.spark.sql.DataFrame = [domain: string, total: bigint]

scala> df1.registerTempTable("people")

scala> csc.sql("select * from people").show()