Failed with exception cannot be cast to

(Mohan P) #1

Continuing the discussion from ElasticSearch 2.1.2 JAR for Hadoop Integration is not working:

CREATE EXTERNAL TABLE TestTable(key STRING,msgtype STRING,app_log_ts STRING) STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'logstash-*/log', 'es.nodes' = '', 'es.port' = '9200','es.mapping.names' = 'key:CLIENT_ORDER_ID,msgtype:MESSAGE_TYPE,app_log_ts:APP_TIME');

Whilke executing select I see exception :
select * from TestTable;
Failed with exception cannot be cast to

NOTE : Its Prints first few the rows, then throws the exception and exit.
I See ES has text for the all the field.

jar :

(Costin Leau) #2
  1. use the latest GA jar (currently 2.2.0) not a milestone.
  2. there's a type mismatch in your mapping, namely a field is mapped as an array while your hive mapping wants a single-valued String. More about it here.

(Mohan P) #3

Hi Costin,
Attribute "" helped to resolve.
Thanks for your quick response !!

(system) #4