DataFrame registerTempTable(注册临时表)后Table Not Found问题的解决
来源:互联网 发布:linux 美国纽约时区 编辑:程序博客网 时间:2024/06/05 20:38
将数据存成数据集的方式是实现数据各种操作非常有效的一种方式。也能够迅速实现数据的导入与导出。
Spark DataFrame提供了registerTempTable这样的接口,可以将数据对象存成临时表,便于后续的各种查询操作等。如select, join等。
以前都是直接从数据中读入数据,生成一个dataframe对象,都没有遇到 table not found的问题。然而今天用手工创建的时候,总是会报这个错误。
经过查资料,才发现由于自己的dataframe是用SQLContext创建的,而用HiveContext是无法访问的。这就涉及到registerTempTable生命周期的问题,以前都没细看,其生命周期只在所定义的sqlContext或hiveContext实例之中。换而言之,在一个sqlontext(或hiveContext)中registerTempTable的表不能在另一个sqlContext(或hiveContext)中使用。
因此,HiveContext来创建DataFrame就没有问题。成功解决。
0 0
- DataFrame registerTempTable(注册临时表)后Table Not Found问题的解决
- DataFrame registerTempTable(注册临时表)后Table Not Found问题的解决
- 解决scp: command not found的问题
- column not found问题的解决
- pod command not found问题的解决
- Nios编程:No CFI table found问题的解决
- 解决Source Not Found问题
- MySQL 5.6 解决InnoDB: Error: Table "mysql"."innodb_table_stats" not found.问题
- debug后显示Source not found的问题处理
- iis发布后出现 .woff 404 (Not Found)的问题
- SparkSQL中DataFrame registerTempTable源码浅析
- 关于 “Version ‘GLIBCXX_3.4.9’ not found”问题的解决
- 解决在Windows下Cygwin Command not found的问题
- bash: scp: command not found问题的解决
- 解决 部分出现valid signing identity not found的问题
- 解决android开发中sqlite3 not found的问题
- dyld: Symbol not found: ___CFObjCIsCollectable 问题的解决
- 解决eclipse调试程序时source not found的问题
- StringBuilder、StringBuffer和String区别
- Spring MVC JSON
- IOS开发之UIView总结
- onTimeSet执行两次问题
- 架构、框架和设计模式关系
- DataFrame registerTempTable(注册临时表)后Table Not Found问题的解决
- QuartZ Cron表达式
- [IOS/UINavigation]设置 UINavigationBar的返回按键图片
- c++实验4—利用循环求和
- IMSI与IMEI 概念
- python调用ahk,并读取ahk的执行结果。
- Android调用手机中的应用市场,实现评分功能
- Spring装配集合的四个方法及实现
- 【bzoj2310】ParkII 插头dp