Re: sparkSession.sql("sql query") vs df.sqlContext().sql(this.query) ?

2017-12-07 Thread khathiravan raj maadhaven
Hi Kant, Based on my understanding, I think the only difference is the overhead of the selection/creation of SqlContext for the query you have passed. As the table / view is already available for use, sparkSession.sql('your query') should be simple & good enough. Following uses the

sparkSession.sql("sql query") vs df.sqlContext().sql(this.query) ?

2017-12-06 Thread kant kodali
Hi All, I have the following snippets of the code and I wonder what is the difference between these two and which one should I use? I am using spark 2.2. Dataset df = sparkSession.readStream() .format("kafka") .load(); df.createOrReplaceTempView("table"); df.printSchema(); *Dataset