Difference between createOrReplaceTempView and registerTempTable

Amogh Huilgol picture Amogh Huilgol · Jul 17, 2017 · Viewed 15.1k times · Source

I am new to spark and was trying out a few commands in sparkSql using python when I came across these two commands:

createOrReplaceTempView() and registerTempTable().

What is the difference between the two commands?. They seem to have same set of functionalities.

Answer

zero323 picture zero323 · Jul 17, 2017

registerTempTable is a part of the 1.x API and has been deprecated in Spark 2.0.

createOrReplaceTempView and createTempView have been introduced in Spark 2.0, as a replacement for registerTempTable.

Other than that registerTempTable and createOrReplaceTempView functionally equivalent and the former one calls the latter one.