Key-Value Pairs Parsing Example using the Variable Operator

You can use the Variable operator to parse data fields that are stored in a key-value pair format, such as JSON, dictionaries, and database STRUCT formats.

The following example illustrates how to refer to the state part of an address value stored as a STRUCT data type in an example Hive data source.

In this example, address is declared as a STRUCT data type column that stores the address fields as name-value pairs:



Within the Variable definition configuration screen, the SQL expression refers to the column name (address) and the value label (state) to parse the actual value from the source STRUCT data type.



The SQL expression used would be <column name>.<value label>. In this example, we use address.state.

For information about the Variable operator, see Variable Operator.