FAILED: SemanticException Unable to determine if hdfs://tmaster:8020/user/root/words.db/test_t2 is encrypted
使用hive时,建立数据库,建表,写数据;
读数据:select * from test_t2;
报错SemanticException
原因:建表时使用了其他路径,或者在另一个路径的数据库(建立数据库时指定了location参数:create database words_db location 'hdfs://tmaster:8020/user/root/words.db')中建表test_t2,也就是因为在建表时没有在默认路径下建立,默认路径是:/user/hive/warehouse/databasename.db/tablename/partition_name (注意要建立分区)
解决方法:
1. 方法一:重新在默认路径下建表,也就是不显式指定location参数,直接默认即可;
例如:建立外部分区表(指定location参数)--- (create table ...)
CREATE EXTERNAL TABLE IF NOT EXISTS test_t1(
column_1 string
,column_2 string
,column_3 string
)PARTITIONED BY (day_time string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE
LOCATION '/user/root/test';
默认建表(不指定location参数):
create table test_t1(column_1 string,column_2 string) partitioned by (day_time string) row format delimited fields terminated by '\1';
其中:row format delimited fields terminated by '\1' 表示行内的列分隔符是'\1'。
2. 方法二:修改设置参数location,参考:https://blog.csdn.net/ggwxk1990/article/details/78067803
建立分区:当设置partitioned by (day_time string)时,表示以day_time来进行分区 --- (alter table ...)
alter table test_t1 add IF NOT EXISTS partition (day_time=''); #或者 (同样可加也可不加:IF NOT EXISTS)
alter table database_name.test_t1 add IF NOT EXISTS partition (day_time='')
一般的流程:建表--->建立分区--->写数据
注意:建数据库和建表时,均有location参数
参考:
https://blog.csdn.net/Thomson617/article/details/86153924
https://blog.csdn.net/qq_36743482/article/details/78383964
## 欢迎交流
FAILED: SemanticException Unable to determine if hdfs://tmaster:8020/user/root/words.db/test_t2 is encrypted的更多相关文章
- Error: Error while compiling statement: FAILED: SemanticException Unable to determine if hdfs://hadoopNode2:8020/user/hive/warehouse/test is encrypted...
1.发现问题: 在hive客户端或者beeline查询hive表时候报错: 根据报错信息查看,是在集群namenode做了HA之后,产生的hdfs路径不对的问题: 2.解决问题,修改hive元数据my ...
- hive sequencefile导入文件遇到FAILED: SemanticException Unable to load data to destination table. Error: The file that you are trying to load does not match the file format of the destination table.错误
hive sequencefile导入文件遇到FAILED: SemanticException Unable to load data to destination table. Error: Th ...
- Unable to determine if the owner (Domain\UserName) of job JOB_NAME has server access
早上巡检的的时候,发现一数据库的作业报如下错误(作业名等敏感信息已经替换),该作业的OWNER为一个域账号: JOB RUN: 'JOB_NAME' was run on 2016-6-1 at 7: ...
- Unable to determine the device handle for GPU 0000:01:00.0: GPU is lost.问题排坑
在运行maskrcnn时,会碰到训练不动的问题,就卡在这儿 UserWarning: Converting sparse IndexedSlices to a dense Tensor of unkn ...
- Java Spring Boot: Unable to determine jdbc url from datasource
如果你和我一样从github或码云上下载了一个几年前别人写的demo代码,想用来做学习用.编译的时候遇到下面这样的错误,然后死命上网查各种方案,百试不灵.试尽了各种方案,就是还连接不上数据库.你可以试 ...
- hadoop_异常_01_ Unable to determine address of the host-falling back to "localhost" address java.net.UnknownHostException: rayner
一.异常现象 安装好hadoop之后,执行格式化namenode命令时,抛出以下异常: // :: WARN net.DNS: Unable to determine local hostname - ...
- Unable to determine the principal end of an association between the types '***. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.
MVC中数据库表如果是一对一的主键关系时要加[Required]不然会出错Unable to determine the principal end of an association between ...
- mongodb 排序 Unable to determine the serialization information for the expression 异常
好久没用mongodb了...最近又开始用起来了. 遇到情景: 2句话分开写.是正常的,因为我是先取再排序的 然而.我想直接排序出来. 就写在了一起.最后.ToList() 然后报 Una ...
- proftpd启动失败提示unable to determine IP address of “xxx.com”
proftpd启动失败提示unable to determine IP address of “xxx.com”这种proftpd启动失败的原因是无法解析后面主机的IP地址,解决方法是在DNS列表中增 ...
随机推荐
- 【CSS3练习】3D盒子制作
先发个3D盒子最终效果图 在线效果预览:http://dtdxrk.github.io/game/css3-demo/box-3d.html 制作步骤1:创建基本结构 分布把6个面定义到3×3的画布上 ...
- Cas(04)——更改认证方式
在Cas Server的WEB-INF目录下有一个deployerConfigContext.xml文件,该文件是基于Spring的配置文件,里面存放的内容常常是部署人员需要修改的内容.其中认证方式也 ...
- DSOFramer 控件(转)
1.Html电子印章.手写签名系统演示:http://www.dianju.com.cn/video.htm在线试用:http://www.dianju.com.cn/websignpiaoju/ht ...
- Dijkstra算法(朴素实现、优先队列优化)
Dijkstra算法只能求取边的权重为非负的图的最短路径,而Bellman-Ford算法可以求取边的权重为负的图的最短路径(但Bellman-Ford算法在图中存在负环的情况下,最短路径是不存在的(负 ...
- VSCode 代码格式化快捷键
转载自:http://geek-docs.com/vscode/vscode-tutorials/vscode-code-formatting.html VSCode 代码格式化快捷键,我们平常在做自 ...
- mysql 转换NULL数据方法
mysql 转换NULL数据方法<pre>SELECT info1,info2, IFNULL(info3,0) as info3 FROM `info1`;</pre>< ...
- synchrnized 和lock的区别
- 阿里云服务器安装mysql8遇到的问题
1.提供一个离线mysql下载路径:http://mirrors.163.com/mysql/Downloads/MySQL-8.0/ 2.在线mysql8安装: 2.1 下载mysql: wget ...
- Word 删除多余空行
打开查找替换框: 「^p^p」(意思:换行,换行)替换为「^p」 「^p^w^p」(意思:换行,空白区域,换行)替换为「^p」 未完 ...... 点击访问原文(进入后根据右侧标签,快速定位到本文)
- 长乐培训Day7
T1 删除 题目 [题目描述] 现在,我的手上有 n 个数字,分别是 a1,a2,a3,...,an. 我现在需要删除其中的 k 个数字.当然我不希望随随便便删除,我希望删除 k 数字之后,剩下的 n ...