解决elasticsearch -在Hive external table 无法读取 date 字段
来源:互联网 发布:leetcode python 编辑:程序博客网 时间:2024/06/13 00:47
1.问题描述
对于@timestamp字段,在es中类型为date,创建hive外表时如果使用类型仍为date,操作时会报如下错误
Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.io.TimestampWritable cannot be cast to org.apache.hadoop.hive.serde2.io.DateWritable
2.解决办法
将date类型改为timestamp即可,例如:CREATE EXTERNAL TABLE ext3 (run_date timestamp) ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe' STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource' = 'dfs/ext3', 'es.field.read.empty.as.null' = 'true','es.nodes'=);
参考:http://www.itkeyword.com/doc/6573413286728074561/unable-to-query-date-field-in-hive-external-table
https://www.iteblog.com/archives/892.html
0 0
- 解决elasticsearch -在Hive external table 无法读取 date 字段
- hive中的外表EXTERNAL TABLE
- hive中的外表EXTERNAL TABLE
- hive中的外表EXTERNAL TABLE
- hive中的外表EXTERNAL TABLE
- Hive Managed Table与 External Table区别
- Hive 之Table、External Table、Partition(五)
- hive external table partition 关联HDFS数据
- Hive create external table partition关联数据文件
- hive external table partition 关联HDFS数据
- hive中Table与External Table的去别
- Moving Data from HDFS to Hive Using an External Table
- external table
- external table
- 解决 unresolved external symbol 无法解析
- 转:解决 unresolved external symbol 无法解析
- Hive Metastore sql 关联查询出Hive Table字段
- elasticsearch text字段排序报错解决
- linux hadoop完全分布式集群搭建图文详解
- Grunt介绍
- java 最占CPU资源的线程
- [剑指offer]用两个栈实现队列
- 在myeclipse中部署tomcat服务器
- 解决elasticsearch -在Hive external table 无法读取 date 字段
- JAVA—键盘录入数据练习
- DAY7轮播图
- 剑指offer:重建二叉树
- 人脸数据库简要介绍
- MATLAB interp1
- python--annacoda和mongodb的安装步骤
- RecyclerView判断是否滑动到底
- [机器学习]前向逐步回归