You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Jakob Homan <jg...@gmail.com> on 2011/04/18 23:14:37 UTC
Evaluating union types in Hive 7?
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
Re: Evaluating union types in Hive 7?
Posted by Amareshwari Sri Ramadasu <am...@yahoo-inc.com>.
As far as I remember, the functionality is not included in original patch. Please raise a jira and feel free to upload a patch if you can.
Thanks
Amareshwari
On 4/19/11 2:44 AM, "Jakob Homan" <jg...@gmail.com> wrote:
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