<?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 Re: How to insert individual rows into hive based on subqueries in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107491#M46516</link>
    <description>&lt;P&gt;Thanks, &lt;A rel="user" href="https://community.cloudera.com/users/235/bpreachuk.html" nodeid="235"&gt;@bpreachuk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Interestingly, I think we found a major Hive bug.&lt;/P&gt;&lt;P&gt;When I run a query like the one above, it appears to enter an infinite loop.&lt;/P&gt;&lt;P&gt;I even pared my data set down to 3 columns - counting 3 tables.&lt;/P&gt;&lt;P&gt;And it appears to spawn MR jobs indefinitely. &lt;/P&gt;&lt;P&gt;I worked around it. But someone should look at the UNION operation. &lt;/P&gt;&lt;P&gt;Happy Friday!&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2016 20:04:28 GMT</pubDate>
    <dc:creator>zack_riesland</dc:creator>
    <dc:date>2016-11-18T20:04:28Z</dc:date>
    <item>
      <title>How to insert individual rows into hive based on subqueries</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107488#M46513</link>
      <description>&lt;P&gt;I am trying to accomplish something like this:&lt;/P&gt;&lt;P&gt;insert into table daily_counts &lt;/P&gt;&lt;P&gt;values&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt; select count(*) from table_a,&lt;/P&gt;&lt;P&gt; select count(*) from table_b&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;...etc.&lt;/P&gt;&lt;P&gt;I know the syntax works for known values. How can I enter the result of a sub-query?&lt;/P&gt;&lt;P&gt;I currently accomplish this in java via jdbc, by running all the queries individually, and then parsing together the final insert statement.&lt;/P&gt;&lt;P&gt;But it MUST be possible with HiveQL, right?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 02:56:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107488#M46513</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-11-17T02:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert individual rows into hive based on subqueries</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107489#M46514</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/2593/zackriesland.html" nodeid="2593"&gt;@Zack Riesland&lt;/A&gt;.  Here's how I normally do this.  It's not specifically a subquery but accomplishes what you're looking for.    &lt;/P&gt;&lt;PRE&gt;insert into table daily_counts
select count(*), 'table_a' from table_a
   UNION 
select count(*), 'table_b' from table_b
   UNION
select count(*), 'table_c' from table_c
...
;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2016 03:03:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107489#M46514</guid>
      <dc:creator>bpreachuk</dc:creator>
      <dc:date>2016-11-17T03:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert individual rows into hive based on subqueries</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107490#M46515</link>
      <description>&lt;P&gt;Edited the post to fix syntax error.  Now it runs just fine.  &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 06:42:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107490#M46515</guid>
      <dc:creator>bpreachuk</dc:creator>
      <dc:date>2016-11-17T06:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert individual rows into hive based on subqueries</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107491#M46516</link>
      <description>&lt;P&gt;Thanks, &lt;A rel="user" href="https://community.cloudera.com/users/235/bpreachuk.html" nodeid="235"&gt;@bpreachuk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Interestingly, I think we found a major Hive bug.&lt;/P&gt;&lt;P&gt;When I run a query like the one above, it appears to enter an infinite loop.&lt;/P&gt;&lt;P&gt;I even pared my data set down to 3 columns - counting 3 tables.&lt;/P&gt;&lt;P&gt;And it appears to spawn MR jobs indefinitely. &lt;/P&gt;&lt;P&gt;I worked around it. But someone should look at the UNION operation. &lt;/P&gt;&lt;P&gt;Happy Friday!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:04:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107491#M46516</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-11-18T20:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert individual rows into hive based on subqueries</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107492#M46517</link>
      <description>&lt;P&gt;Yikes!  Have never seen that happen before, but I certainly have no reason to doubt you.  Does it happen with hive.execution.engine=tez?  If you could grab &amp;amp; sanitize your query/config details &amp;amp; post that as a Hive bug in Jira it would be greatly appreciated...  we don't want that problem to bite anyone else.  &lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:11:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-insert-individual-rows-into-hive-based-on-subqueries/m-p/107492#M46517</guid>
      <dc:creator>bpreachuk</dc:creator>
      <dc:date>2016-11-18T20:11:20Z</dc:date>
    </item>
  </channel>
</rss>

