<?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: Unable to execute statement INSERT INTO SELECT in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142436#M40091</link>
    <description>&lt;P&gt;Just so that every body knows - using the "use native query" in the ODBC driver make it work in my case.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2016 18:18:08 GMT</pubDate>
    <dc:creator>moreau</dc:creator>
    <dc:date>2016-09-09T18:18:08Z</dc:date>
    <item>
      <title>Unable to execute statement INSERT INTO SELECT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142432#M40087</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to integrate the ODBC connectivity to Hortonworks plateform into our marketing data management software&lt;/P&gt;&lt;P&gt;I'm having an issue runing a query INSERT INTO TableX (Col1) SELECT col1 from Table1 UNION SELECT col2 FROM Table2&lt;/P&gt;&lt;P&gt;using the ODBC connection where as the exact same statement works fine when run through Hive View&lt;/P&gt;&lt;P&gt;Here are some details : &lt;/P&gt;&lt;P&gt;Structure of tables used as sources: &lt;/P&gt;&lt;PRE&gt;CREATE TABLE wkf107422_10_1( sextkey STRING, 
                             sinfosfirstname STRING, 
                             sinfosname STRING, 
                             spersid STRING); 
ALTER TABLE wkf107422_10_1 SET SERDEPROPERTIES  ('serialization.encoding'='UTF8')&lt;/PRE&gt;&lt;PRE&gt;CREATE TABLE wkf107422_11_1( sextkey STRING, 
                             sinfosfirstname STRING, 
                             sinfosname STRING, 
                             spersid STRING);
ALTER TABLE wkf107422_11_1 SET SERDEPROPERTIES  ('serialization.encoding'='UTF8') ;&lt;/PRE&gt;&lt;P&gt;Structure of the table used as destination&lt;/P&gt;&lt;PRE&gt;CREATE TABLE wkf107422_12_1_0( sextkey STRING, 
                               sinfosfirstname STRING, 
                               sinfosname STRING, 
                               spersid STRING) ; 
ALTER TABLE wkf107422_12_1_0 SET SERDEPROPERTIES ('serialization.encoding'='UTF8') ; &lt;/PRE&gt;&lt;P&gt;Statements that is failing :&lt;/P&gt;&lt;PRE&gt;INSERT INTO wkf107422_12_1_0 ( spersid ) 
  SELECT spersid FROM wkf107422_11_1 UNION SELECT spersid FROM wkf107422_10_1 &lt;/PRE&gt;&lt;P&gt;Any advice on what I'm doing wrong there ?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 15:47:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142432#M40087</guid>
      <dc:creator>moreau</dc:creator>
      <dc:date>2016-09-08T15:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to execute statement INSERT INTO SELECT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142433#M40088</link>
      <description>&lt;P&gt;As a complementary information I've tried to replace the INSERT INTO by a CREATE TABLE AS SELECT&lt;/P&gt;&lt;PRE&gt;CREATE TABLE wkf107422_12_1_1  AS 
    SELECT spersid FROM wkf107422_11_1 UNION SELECT spersid FROM wkf107422_10_1
&lt;/PRE&gt;&lt;P&gt;and this one works through the same ODBC connection &lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 15:57:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142433#M40088</guid>
      <dc:creator>moreau</dc:creator>
      <dc:date>2016-09-08T15:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to execute statement INSERT INTO SELECT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142434#M40089</link>
      <description>&lt;P&gt;The column list specification "INSERT INTO wkf107422_12_1_0 ( spersid )" is available starting with Hive-1.2 but you are most likely using an older version of Hive which doesn't support this feature (added by &lt;A href="https://issues.apache.org/jira/browse/HIVE-9481"&gt;HIVE-9481&lt;/A&gt;). In old versions your SELECT statement has to provide all schema columns, in your case all 4. Regarding your "complementary information", it works but the resulting table wkf107422_12_1_1 contains only one column corresponding to spersid. To confirm try "describe wkf107422_12_1_1".&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 16:21:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142434#M40089</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-09-08T16:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to execute statement INSERT INTO SELECT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142435#M40090</link>
      <description>&lt;P&gt;Indeed the table as only one column (I knew this but just wanted to add more info to the description)&lt;/P&gt;&lt;P&gt;The issue might be realted to Hive odbc driver from Hortonworks since it indeed works with Hive view (web page)&lt;/P&gt;&lt;PRE&gt;ODBC driver version is version 2.1.2.1002 (32 bits) &lt;/PRE&gt;&lt;P&gt;the server versions are from the ps -auxwww | grep -i HIve of the test VM I'm using from hortonworks : &lt;/P&gt;&lt;PRE&gt;hive-service-1.2.1000.2.4.0.0-169.jar
hive-webhcat-1.2.1000.2.4.0.0-169.jar&lt;/PRE&gt;&lt;P&gt;I've tested that if I change the CREATE TABLE for wkf107422_12_1_0 to have only one column it work in both in ODBC and Hive view&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 18:52:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142435#M40090</guid>
      <dc:creator>moreau</dc:creator>
      <dc:date>2016-09-08T18:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to execute statement INSERT INTO SELECT</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142436#M40091</link>
      <description>&lt;P&gt;Just so that every body knows - using the "use native query" in the ODBC driver make it work in my case.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 18:18:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-execute-statement-INSERT-INTO-SELECT/m-p/142436#M40091</guid>
      <dc:creator>moreau</dc:creator>
      <dc:date>2016-09-09T18:18:08Z</dc:date>
    </item>
  </channel>
</rss>

