<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question ADD TWO TABLES IN HIVE in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ADD-TWO-TABLES-IN-HIVE/m-p/58149#M65638</link>
    <description>&lt;P&gt;I would like to add the table in a single table if anyone knows kindly let me know, I am getting below errors.&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; use final;
OK
Time taken: 0.057 seconds
hive&amp;gt; show tables;
OK
crimeloc13
crimeloc14
crimeloc15
crimeloc16
Time taken: 0.209 seconds
hive&amp;gt; select a.loc,a.cnt13 from crimeloc13 a UNION ALL select b.cnt14 from crimeloc14 b;
FAILED: SemanticException 1:26 Top level UNION is not supported currently; use a subquery for the UNION. Error encountered near token 'cnt14'
hive&amp;gt; &lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Sep 2022 11:59:37 GMT</pubDate>
    <dc:creator>saisvk</dc:creator>
    <dc:date>2022-09-16T11:59:37Z</dc:date>
    <item>
      <title>ADD TWO TABLES IN HIVE</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ADD-TWO-TABLES-IN-HIVE/m-p/58149#M65638</link>
      <description>&lt;P&gt;I would like to add the table in a single table if anyone knows kindly let me know, I am getting below errors.&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; use final;
OK
Time taken: 0.057 seconds
hive&amp;gt; show tables;
OK
crimeloc13
crimeloc14
crimeloc15
crimeloc16
Time taken: 0.209 seconds
hive&amp;gt; select a.loc,a.cnt13 from crimeloc13 a UNION ALL select b.cnt14 from crimeloc14 b;
FAILED: SemanticException 1:26 Top level UNION is not supported currently; use a subquery for the UNION. Error encountered near token 'cnt14'
hive&amp;gt; &lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:59:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/ADD-TWO-TABLES-IN-HIVE/m-p/58149#M65638</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2022-09-16T11:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: ADD TWO TABLES IN HIVE</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/ADD-TWO-TABLES-IN-HIVE/m-p/58340#M65639</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As the error message indicated, UNION ALL is not supported at top level, you need to put it in a sub query, similar to below:&lt;BR /&gt;&lt;BR /&gt;SELECT loc, cnt FROM (&lt;BR /&gt;select a.loc as loc, a.cnt13 cnt&lt;BR /&gt;from crimeloc13 a&lt;BR /&gt;UNION ALL&lt;BR /&gt;select b.loc as loc, b.cnt14 as cnt&lt;BR /&gt;from crimeloc14 b&lt;BR /&gt;) a;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Aug 2017 11:19:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/ADD-TWO-TABLES-IN-HIVE/m-p/58340#M65639</guid>
      <dc:creator>EricL</dc:creator>
      <dc:date>2017-08-02T11:19:48Z</dc:date>
    </item>
  </channel>
</rss>

