# ClassCastException with nested array in hive over elasticsearch

**URL:** <https://discuss.elastic.co/t/classcastexception-with-nested-array-in-hive-over-elasticsearch/191344>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [July 19, 2019, 8:21am UTC](https://discuss.elastic.co/t/classcastexception-with-nested-array-in-hive-over-elasticsearch/191344 "2019-07-19T08:21:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun\_r](https://avatars.discourse-cdn.com/v4/letter/v/9fc29f/32.png) [@varun\_r](https://discuss.elastic.co/u/varun_r)\
**Post date:** [July 19, 2019, 8:21am UTC](https://discuss.elastic.co/t/classcastexception-with-nested-array-in-hive-over-elasticsearch/191344/1 "2019-07-19T08:21:03Z")

</div>

I am using elasticsearch-hadoop-hive-7.2.0.jar to use elasticsearch tables on hive.  
However couldn't get it work with nested column.

CREATE EXTERNAL TABLE test2019197  
(fault\_details struct\<faults:array\<struct\<Details:string, Resolution:string\>\>\>)  
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
TBLPROPERTIES('es.nodes'='[11111.us-central1.gcp.cloud.es.io:9243](http://11111.us-central1.gcp.cloud.es.io:9243)',  
'es.mapping.names' = 'fault\_details:fault\_details',  
'es.net.ssl'='true',  
'es.resource' = 'test2019197',  
'es.nodes.wan.only' = 'true',  
'es.index.read.missing.as.empty'='false');

For this particular column my es data looks like:  
"fault\_details" : {  
"faults" : [  
{  
"Resolution" : "Bright",  
"Details" : "Reject"  
},  
{  
"Resolution" : "Reduce Brightness",  
"Details" : "Reject"  
}  
]  
},

I tried with multiple mapping/without map with string column but got the classcast exception which should come as the datatype mismatches on both sides.  
But can some have a look over the above ; as now i am using the similar datatype as of es.

error: Failed with exception java.io.IOException:java.lang.ClassCastException: org.elasticsearch.hadoop.mr.WritableArrayWritable cannot be cast to org.apache.hadoop.io.MapWritable

TIA

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 16, 2019, 8:28am UTC](https://discuss.elastic.co/t/classcastexception-with-nested-array-in-hive-over-elasticsearch/191344/2 "2019-08-16T08:28:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
