I have a table in Athena (presto) with just one column named individuals
and this is the type of then column:
array(row(individual_id varchar, ids array(row(type varchar, value varchar, score integer))))
I want to extract value
from inside the ids
and return them as a new array. As an example:
[{individual_id=B1Q, ids=[{type=H, value=efd3, score=1}, {type=K, value=NpS, score=1}]}, {individual_id=D6n, ids=[{type=A, value=178, score=6}, {type=K, value=NuHV, score=8}]}]
and I want to return
ids
[efd3, NpS, 178, NuHV]
I tried multiple solutions like
select * from "test"
CROSS JOIN UNNEST(individuals.ids.value) AS t(i)
but always return
Expression individuals is not of type ROW
question from:
https://stackoverflow.com/questions/65930870/extract-array-of-arrays-in-presto 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…