how to run select query for impala struct column

355 Views Asked by At

Given table address as,

Column Type
id int
country struct< name:string, city:array>

I need a select query which would produce result set in the below structure? Query would be run by a java program.

id country
1 example_struct_object
2 example_struct_object

Having this in mind for impala - with regards to complex types.

The result set of an Impala query always contains all scalar types; the elements and fields within any complex type queries must be "unpacked" using join queries.

ie. select * from details; would only return results without the struct column complex type).

Thanks.

0

There are 0 best solutions below