Can anyone recommend a good approach for interrogating uniontype values in
HQL? I note that the documentation states that the support for such types
is limited to 'look-at-only' which I assume to mean that I may only dump
out the value in its entirety, and extract sub-elements. Using the example
below, is there anyway I can get to field 'b' of union index 3 to extract
only the value 5?

{0:1}
{1:2.0}
{2:["three","four"]}
{3:{"a":5,"b":"five"}}


If not possible with HQL, would it be possible to implement a UDF that can
explode the type into something more navigable, like an array, struct, or
map?

Example when exploded as array:


[1,null,null,null]
[null,2.0,null,null]
[null,null,["three","four"],null]
[null,null,null,{"a":5,"b":"five"}]

Has anyone done this?

Thanks,

Elliot.

Reply via email to