Reading Structs

Columns in Parquet and ORC files can contain complex data types.  One complex data type is the struct, which stores (typed) property-value pairs. For example, an address column could use a struct with strings for the street address, city/state, and postal code, such as { "street":"150 Cambridgepark Dr.", "city":"Cambridge MA", "postalcode":"02140"}. (This is a Hive display format, not literally what is stored in the data file.)

Vertica provides two ways to read struct data in an external table. You can expand the struct by defining one column for each struct field, and then query those columns as you would any others. This approach is explained in Reading Structs as Expanded Columns. Alternatively, for Parquet files only, you can represent the struct in a single column and use a modified query syntax to query them. This approach is explained in Reading Structs as Inline Types.

In This Section