<?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: importing data in hive from a location in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154720#M117161</link>
    <description>&lt;P&gt;ALTER TABLE MAGNETO.SALES_FLAT_ORDER  SET SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'&lt;/P&gt;&lt;P&gt;assuming you have hive 0.14 or later.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2016 01:17:42 GMT</pubDate>
    <dc:creator>mqureshi</dc:creator>
    <dc:date>2016-06-24T01:17:42Z</dc:date>
    <item>
      <title>importing data in hive from a location</title>
      <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154715#M117156</link>
      <description>&lt;P&gt;
	I created schema for my table through a sqoop job:&lt;/P&gt;
&lt;PRE&gt;sqoop job --meta-connect jdbc:hsqldb:hsql://IP:16000/sqoop --create sales_flat_order_initialjob -- import --driver com.mysql.jdbc.Driver --connect jdbc:mysql://IP/db?zeroDateTimeBehavior=convertToNull --username root --password 'perconaMYSQL' --table sales_flat_order --incremental lastmodified --check-column wh_update --last-value 0 --merge-key entity_id --split-by entity_id --hive-import --hive-database Magento --hive-drop-import-delims
&lt;/PRE&gt;&lt;P&gt;
	After executing this, I now have the schema and data.&lt;/P&gt;&lt;P&gt;
	For incremental imports:&lt;/P&gt;&lt;OL&gt;
	&lt;LI&gt;I replaced --hive-import with --target dir&lt;/LI&gt;&lt;/OL&gt;
&lt;PRE&gt;sqoop job --meta-connect jdbc:hsqldb:hsql://warehouse.swtched.com:16000/sqoop --create sales_flat_order_initialjob -- import --driver com.mysql.jdbc.Driver --connect jdbc:mysql://ip/db?zeroDateTimeBehavior=convertToNull --username root --password 'perconaMYSQL' --table sales_flat_order --incremental lastmodified --check-column wh_update --last-value 0 --merge-key entity_id --split-by entity_id --target-dir /location --hive-database Magento --hive-drop-import-delims
&lt;/PRE&gt;&lt;P&gt;Now, I changed this table to an external table&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;changed location to that of target.&lt;/P&gt;&lt;P&gt;Now, I get all 'NULLS' in all columns for all rows.&lt;/P&gt;&lt;P&gt;What looks like the issue?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 23:52:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154715#M117156</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-23T23:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: importing data in hive from a location</title>
      <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154716#M117157</link>
      <description>&lt;P&gt;It is likely an issue of field delimiter. Default in Hive is ^A. you should specify what your fields are delimited by.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--fields-terminated-by&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; Might want to do --lines-terminated-by also.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 00:13:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154716#M117157</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-06-24T00:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: importing data in hive from a location</title>
      <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154717#M117158</link>
      <description>&lt;P&gt;I understood that but not sure how to specify the delimiters and what should be the delimiters? Could you please be more specific? &lt;A rel="user" href="https://community.cloudera.com/users/10969/mqureshi.html" nodeid="10969"&gt;@mqureshi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 00:42:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154717#M117158</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-24T00:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: importing data in hive from a location</title>
      <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154718#M117159</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10486/simrank.html" nodeid="10486"&gt;@Simran Kaur&lt;/A&gt; check your data by doing a "cat" to see what the data looks like. Are fields separated by a space or whatever it is. You can also instead create a table and in create table statement specify what you want your fields to be terminated by and then do an import using Sqoop. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 00:47:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154718#M117159</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-06-24T00:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: importing data in hive from a location</title>
      <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154719#M117160</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10969/mqureshi.html" nodeid="10969"&gt;@mqureshi&lt;/A&gt; : Fields seem to be separated by comma. How do I update this for an existing table? I don't want to create the table manually since there are a lot of columns.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 00:53:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154719#M117160</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-24T00:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: importing data in hive from a location</title>
      <link>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154720#M117161</link>
      <description>&lt;P&gt;ALTER TABLE MAGNETO.SALES_FLAT_ORDER  SET SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'&lt;/P&gt;&lt;P&gt;assuming you have hive 0.14 or later.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 01:17:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/importing-data-in-hive-from-a-location/m-p/154720#M117161</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-06-24T01:17:42Z</dc:date>
    </item>
  </channel>
</rss>

