Difference between createOrReplaceTempView and registerTempTable

前端 未结 3 1491
离开以前
离开以前 2020-12-28 15:07

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 regis

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 15:39

    Both the function between createOrReplaceTempView and registerTempTable are same and have same functionalities.

    However registerTempTable is depricated from spark 2.0.0

    Instead of registerTempTable, createOrReplaceTempView is used

    @deprecated("Use createOrReplaceTempView(viewName) instead.", "2.0.0")
      def registerTempTable(tableName: String): Unit = {
        createOrReplaceTempView(tableName)
      }
    

提交回复
热议问题