The exception occurs because you are trying to extract a field (the script parameters) from a complex type (array) and not a primitive. The issue with that (and why it's currently not supported) is because the internal structure of the complex type can get quite complex and its serialized, JSON form incorrect. Any reason why you need to pass the array of maps as a script parameter and not use primitives instead (you can use Hive column mapping to extract the ones you need)?
On Thu, Mar 12, 2015 at 11:56 PM, Chen Wang <chen.apache.s...@gmail.com> wrote: > Folks, > I am using elasticsearch-hadoop-hive-2.1.0.Beta3.jar > > I defined the external table as:. > CREATE EXTERNAL TABLE IF NOT EXISTS ${staging_table}( > customer_id STRING, > store_purchase array<map<string,string>>) > ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe' > STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' > TBLPROPERTIES ( > 'es.nodes'='localhost:9200', > 'es.resource'='user_activity/store', > 'es.mapping.id'='customer_id', > 'es.input.json'='false', > 'es.write.operation'='upsert', > 'es.update.script'='ctx._source.store_purchase += purchase', > 'es.update.script.params'='purchase:store_purchase' > ) ;" > > I create another source table with the same column names and put some > sample data. > > Running INSERT OVERWRITE TABLE ${staging_table} > > SELECT customer_id, store_purchase) FROM ${test_table} > > but it throws EsHadoopIllegalArgumentException: Field [_col1] needs to be > a primitive; found [array>]. Is array> supported yet? If not, how can I get > around this issue? > > Thanks~ > > -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elasticsearch+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/929c7b5b-fbb4-4232-821b-331499c18369%40googlegroups.com > <https://groups.google.com/d/msgid/elasticsearch/929c7b5b-fbb4-4232-821b-331499c18369%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAJogdmdtqpqyK%2BYGKDmkZwxFUJtpqty-q1Q1WrOAXwFB24zgaw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.