I'm having trouble using the union type introduced in HIVE-537.
Consider a table with a column, union1, with a union type
uniontype<float,boolean,string>.  While it's possible to select this
column:
OK



                                                          {1:true}
{2:"union1value 2"}
{1:false}
{2:"union1value 4"}

it doesn't seem to be possible to filter on this column or do any type
of comparison:
hive> select union1 from kst where union1=true limit 10;
FAILED: Error in semantic analysis: line 1:29 Argument Type Mismatch
union1: The 1st argument of EQUAL  is expected to a primitive type,
but union is found

There doesn't appear to be any operator for dereferencing the value
held by the union, and nesting the create_union UDF isn't legal either
(thank goodness, that would be a horrible way to interact with
unions).  Am I missing something, or was this functionality not
included in the original patch?  There's no documentation on unions,
and I'd be happy to file a patch to add some, once I can get data out
from them.

Thanks,
Jakob

Reply via email to