完全无法从蜂巢外部表中获取数据。到目前为止,我已经完成了下面的工作。
问题1:我的弹性搜索字段创建为string。
问题2当我从ext3查询外部表的数据时,比如选择计数(*),我得到的是错误。
2015-04-17 18:45:34,254 FATAL [main] org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row [Error getting row data with exception java.lang.ClassCastException: org.apache.hadoop.hive.serde2.io.TimestampWritable cannot be cast to org.apache.hadoop.hive.serde2.io.DateWritable
at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableDateObjectInspector.getPrimitiveWritableObject(WritableDateObjectInspector.java:38)
at org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(SerDeUtils.java:259)
at org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(SerDeUtils.java:349)
at org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(SerDeUtils.java:193)
at org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(SerDeUtils.java:179)
at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:545)伙计们,请帮帮我,这一整天都白费了。我有另一个具有更多数据的外部表,我需要将这两个表连接起来,并创建一个视图,使我的合并数据可以进行分析。
发布于 2015-04-17 12:07:26
我认为这个错误为你的问题提供了一个线索:
Error getting row data with exception java.lang.ClassCastException:
org.apache.hadoop.hive.serde2.io.TimestampWritable cannot be cast to
org.apache.hadoop.hive.serde2.io.DateWritable您的单元表中有一个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'=);https://stackoverflow.com/questions/29697493
复制相似问题