How to select where condition from complex data type - Hive


#1

Hi,

I have a table in Hive and the description of the table is

describe nbsxml_accountdetails;
OK
accountid      string 
customer_details    array<struct<customer:struct<customerid:string, firstname:string, lastname:string,
reltypecd:string,>>>  

and the data is like this

12346   [{"customer":{"customerid":"NONE","firstname":"beth","lastname":"Kur","reltypecd":"NSPS"}},{"customer":{"customerid":"NONE","firstname":"Marin","lastname":"cman","reltypecd":"ABCD"}}]

12347   [{"customer":{"customerid":"NONE","firstname":"guk","lastname":"Kur","reltypecd":"NSPS"}},{"customer":{"customerid":"NONE","firstname":"merlin","lastname":"juiv","reltypecd":"CVF"}}]

from this How to select where condition for customer_details if the customer firstname is “Marin”?

I tried
select customer_details.customer.firstname from nbsxml_accountdetails where customer_details.customer.firstname = "Marin"

It throws me an error. Can any one please help me on this.