createOrReplaceTempView 和 registerTempTable 的区别 [英] Difference between createOrReplaceTempView and registerTempTable
问题描述
我是 spark 新手,当我遇到这两个命令时,我正在使用 python 在 sparkSql
中尝试一些命令:
I am new to spark and was trying out a few commands in sparkSql
using python when I came across these two commands:
createOrReplaceTempView() 和 registerTempTable().
这两个命令有什么区别?.它们似乎具有相同的功能集.
What is the difference between the two commands?. They seem to have same set of functionalities.
推荐答案
registerTempTable
是 1.x API 的一部分,已在 Spark 2.0 中弃用.
registerTempTable
is a part of the 1.x API and has been deprecated in Spark 2.0.
createOrReplaceTempView
和 createTempView
已在 Spark 2.0 中引入,作为 registerTempTable
的替代品.
createOrReplaceTempView
and createTempView
have been introduced in Spark 2.0, as a replacement for registerTempTable
.
除此之外,registerTempTable
和 createOrReplaceTempView
在功能上等价,前者调用后者.
Other than that registerTempTable
and createOrReplaceTempView
functionally equivalent and the former one calls the latter one.
这篇关于createOrReplaceTempView 和 registerTempTable 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!