Grokbase Groups Hive user April 2011
FAQ
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

Search Discussions

  • Amareshwari Sri Ramadasu at Apr 19, 2011 at 1:17 pm
    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" 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedApr 19, '11 at 1:15p
activeApr 19, '11 at 1:17p
posts2
users2
websitehive.apache.org

People

Translate

site design / logo © 2022 Grokbase