SPARK SQL 中registerTempTable与saveAsTable的区别
使用registerTempTable注册表是一个临时表,生命周期只在所定义的sqlContext或hiveContext实例之中。换而言之,在一个sqlontext(或hiveContext)中registerTempTable的表不能在另一个sqlContext(或hiveContext)中使用。
而saveAsTable则是永久的,只要连接存在,spark再启的时候,这个表还是在的。
官网上的描述:
Unlike theregisterTempTable command, saveAsTable will materialize the contents of the dataframe and create a pointer to the data in the HiveMetastore. Persistent tables will still exist even after your Spark program has restarted, as long as you maintain your connection to the same metastore. A DataFrame for a persistent table can be created by calling the table method on a SQLContext with the name of the table.
SPARK SQL 中registerTempTable与saveAsTable的区别的更多相关文章
- Spark SQL中UDF和UDAF
转载自:https://blog.csdn.net/u012297062/article/details/52227909 UDF: User Defined Function,用户自定义的函数,函数 ...
- Spark SQL中列转行(UNPIVOT)的两种方法
行列之间的互相转换是ETL中的常见需求,在Spark SQL中,行转列有内建的PIVOT函数可用,没什么特别之处.而列转行要稍微麻烦点.本文整理了2种可行的列转行方法,供参考. 本文链接:https: ...
- SQL中ON和WHERE的区别
SQL中ON和WHERE的区别 - 邃蓝星空 - 博客园 https://www.cnblogs.com/guanshan/articles/guan062.html
- spark sql中进行sechema合并
spark sql中支持sechema合并的操作. 直接上官方的代码吧. val sqlContext = new org.apache.spark.sql.SQLContext(sc) // sql ...
- Spark SQL中出现 CROSS JOIN 问题解决
Spark SQL中出现 CROSS JOIN 问题解决 1.问题显示如下所示: Use the CROSS JOIN syntax to allow cartesian products b ...
- Spark SQL中的Catalyst 的工作机制
Spark SQL中的Catalyst 的工作机制 答:不管是SQL.Hive SQL还是DataFrame.Dataset触发Action Job的时候,都会经过解析变成unresolved的逻 ...
- Spark sql -- Spark sql中的窗口函数和对应的api
一.窗口函数种类 ranking 排名类 analytic 分析类 aggregate 聚合类 Function Type SQL DataFrame API Description Ranking ...
- 【原创】大叔经验分享(84)spark sql中设置hive.exec.max.dynamic.partitions无效
spark 2.4 spark sql中执行 set hive.exec.max.dynamic.partitions=10000; 后再执行sql依然会报错: org.apache.hadoop.h ...
- Spark SQL中Not in Subquery为何低效以及如何规避
首先看个Not in Subquery的SQL: // test_partition1 和 test_partition2为Hive外部分区表 select * from test_partition ...
随机推荐
- wordpress 首页调用文章 不同样式的方法
<?php $count = 1; $display_categories = array(1); foreach ($display_categories as $category) { ?& ...
- as3 中文转拼音
private static const PinYin:Object = {"a":"\u554a\u963f\u9515","ai":&q ...
- CBitmap、HBITMAP、BITMAP相互转换
一:理解 BITMAP是C++中定义的位图结构体 HBITMAP是Windows中使用的位图句柄 CBitmap是MFC封装的位图类 二:相互转换 1.HBITMAP->CBitmap 方法一: ...
- 学习中的错误——ubuntu 14.04 LTS 启动eclipse报错
在ubuntu中启动eclipse报错:(Eclipse:15978): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assert ...
- Multivariance Linear Regression练习
%% 方法一:梯度下降法 x = load('E:\workstation\data\ex3x.dat'); y = load('E:\workstation\data\ex3y.dat'); x = ...
- C++Primer 一
1.vertor和数组的区别: 数组的长度固定.而且程序是无法知道一个给定数组的长度,数组没有获取器容量大小的size操作,也不提供puch_back操作在其中自动添加元素 2.数组定义中的类型可以示 ...
- 【python】属性
在python中,一切皆是对象(object),对象拥有很多属性(arrtribute) 属性分2种 类属性(class attribute):类自身定义or继承 对象属性(object attrib ...
- Java 数组声明与初始化
引言 学习了好久的java,每次要写数组的声明和初始化代码,总是理不清.最近又碰到了一次这种情况.这次拿出<Thinking In Java>好好总结一翻. 数组声明 对于数组的声明其实都 ...
- COMP9020
outline: numbers, sets, functions week 1logic week 2–3relation theory week 5–6graphs and trees week ...
- 关于css的新思考
因为被派去协助别的组,有机会写了一下react,发现ICE做的那一个套件用来搭建后台系统真的太给力了(插一句必入table组件其实是可以把删除添加座位基础方法加进去的).因为看了demo的代码以及对于 ...