gpt4 book ai didi

apache-spark - createOrReplaceGlobalTempView 和 createOrReplaceTempView 之间的区别

转载 作者:行者123 更新时间:2023-12-01 16:06:18 25 4
gpt4 key购买 nike

我试图了解 createOrReplaceGlobalTempView 和 createOrReplaceTempView 之间的区别。

createOrReplaceTempView是在2.0版本中引入的,createOrReplaceGlobalTempView是在2.2版本中引入的。

根据文档,

对于 createOrReplaceGlobalTempView :此临时 View 的生命周期与此 Spark 应用程序相关联。

对于 createOrReplaceGlobalTempView :此临时表的生命周期与用于创建此 DataFrame 的 SparkSession 相关联。

能否请您详细说明一下 Spark Application 和 SparkSession 的区别。

问候,

尼拉吉

最佳答案

标准临时表位于用户空间中,similarly to Hive

The data in these tables is stored in the user's scratch directory rather than in the Hive warehouse directory. The scratch directory effectively acts as the user' data sandbox.

并且仅限于单个用户 session 。

全局临时 View 的不同之处在于,可以被多个 session 访问,因此在普通 View (可以全局访问,它注册在全局临时数据库中)和临时 View (其范围是仅限于单个 session )。

关于apache-spark - createOrReplaceGlobalTempView 和 createOrReplaceTempView 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48519038/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com