Home Forums Hive / HCatalog UNION ALL

This topic contains 2 replies, has 2 voices, and was last updated by  Mark Robinson 11 months ago.

  • Creator
    Topic
  • #32904

    I’m using Hive in the v2.0 Sandbox and am getting an ‘Unknown exception’ when I run the following:

    select taccode, manufacturer, handset
    from tac_code
    where t1.manufacturer = ‘Apple’
    union all
    select taccode, manufacturer, handset
    from tac_code
    where manufacturer = ‘HTC’;

    Can anyone please advise what I have done wrong? Note this is a simplified query and not the one I really want to run. Both of the selects work individually – it’s only when I combine them with the union all I get the error.

    Any advice would be much appreciated – thank you in advance. And information on how to turn on sensible error messages instead of the ‘Unknown exception’ which is all I get would also be very welcome!

    Mark

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #33054

    Hi Yi,

    That method works beautifully – thank you very much for your help.

    Kind regards,
    Mark

    Collapse
    #32975

    Yi
    Member

    Hi Mark,

    Top level union all is not supported. Can you try this

    select * from
    (select taccode, manufacturer, handset
    from tac_code
    where t1.manufacturer = ‘Apple’
    union all
    select taccode, manufacturer, handset
    from tac_code
    where manufacturer = ‘HTC’) tmp;

    Thank,
    Yi

    Collapse
Viewing 2 replies - 1 through 2 (of 2 total)