Many times, you have data structures with nested arrays that you contain values that you want to join against.

An example JSON data structure:

         { 
"customer_id":"ada13232",
"values": [
{"hello":"earth"},
{"hello":"mars"}
]
}

To access values for "hello", you can use the explode function.

Here is an example statement:

  - statement: |
(helloValues) => select
source.customer_id,
a.values.*
from sourceData source
lateral view explode(source.values) a as values

To output:

https://cdn.elev.io/file/uploads/FN41vWv37qBXcOTKPoWingt4hadHzu4oYSEfQWEe03g/i5nDpVIOlYWp2dDtFdAFfdPoNHJhmuAhtBY0hEggaew/explode-dFg.png

A recipe template that demonstrates explode is Convert Nested Array to Table .

You may also want to look at the inline function if explode doesn't meet your needs.

The inline function will simply convert the array as an table:

https://cdn.elev.io/file/uploads/FN41vWv37qBXcOTKPoWingt4hadHzu4oYSEfQWEe03g/qkkbuDd5Cl2UkZgdjTUaQkI2uOfdHilFUdljXUP3eb8/inline-Vjc.png