An Apache hive table has the following column definition:
myvars:array<struct<index:bigint,value:string>>
An example for the corresponding data is:
"myvars":[
{"index":2,"value":"value1"}
, {"index":1,"value":"value2"}
, {"index":2,"value":"value3"}
]
How can this array be filtered to all elements where "index"==2.
In JavaScript I would do something like the following:
myvars.filter(function(d){return d.index==2;})
How can the same result be achieved with Apache Hive QL, preferably without lateral views?