【问题标题】:Difference between createOrReplaceGlobalTempView and createOrReplaceTempViewcreateOrReplaceGlobalTempView 和 createOrReplaceTempView 的区别
【发布时间】:2018-01-30 10:21:43
【问题描述】:

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

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

根据文档,

for createOrReplaceGlobalTempView :此临时视图的生命周期与此 Spark 应用程序相关联。

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

能否详细说明 Spark Application 和 SparkSession 的区别。

问候,

尼拉杰

【问题讨论】:

标签: apache-spark pyspark


【解决方案1】:

标准临时表存在于用户空间,similarly to Hive

这些表中的数据存储在用户的临时目录中,而不是 Hive 仓库目录中。临时目录有效地充当用户的数据沙箱。

并且仅限于单个用户会话。

全局临时视图,不同的是,可以被多个会话访问,所以在普通视图(可以全局访问,在全局临时数据库中注册)和临时视图(其范围是仅限于一个会话)。

【讨论】:

    猜你喜欢
    • 2017-12-22
    • 2017-09-24
    • 1970-01-01
    • 2017-08-04
    • 1970-01-01
    • 2013-08-07
    • 2011-10-20
    • 2020-01-23
    • 1970-01-01
    相关资源
    最近更新 更多