0

I created an Hive external table to query the existing data of es like below

CREATE EXTERNAL TABLE ods_es_data_inc
(`agent_id`          STRING,
 `dt_server_time`    TIMESTAMP
) COMMENT 'bb_i_app'
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES(
    'es.resource'='data*',
    'es.nodes'='ip',
    'es.port'='port',
    'es.net.http.auth.user'='user',
    'es.net.http.auth.pass'='pass'
)

when I query date field in Hive external table,I am getting below error Error: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.TimestampwritableV2 (state=,code=0)

My situation is very similar to this problem.But I have used the timestamp field when I create external table.

My component version: Hive:3.1.0 ES-Hadoop:6.8.7 Elasticsearch:6.7.1

I switched Hive's execution engine from mr to spark.The error has not changed. After eliminating the component problem, I don't know whether it is the version mismatch or the table creation problem.

Sam
  • 1
  • 1

0 Answers0