how to overwrite the data in hive using sqoop
<p>I am trying to load data into an already existing table in hive via sqoop from mysql database. I am referring to the below guide for reference:-
<a href="http://sqoop.apache.org/docs/1.4.5/SqoopUserGuide.html#_importing_data_into_hive" rel="nofollow">http://sqoop.apache.org/docs/1.4.5/SqoopUserGuide.html#_importing_data_into_hive</a> </p>

<p><code>--hive-import</code> has been tried and tested successfully.</p>

<p>I created a hive table as below:-</p>

<ol>
<li><p><code>create table sqoophive (id int, name string, location string)
row format delimited
fields terminated by '\t'
lines terminated by '\n'
stored as textfile;</code></p></li>
<li><p>Loaded the data as required.</p></li>
<li><p>I want to use <code>--hive-overwrite</code> option to overwrite the content in the above table. As per the guide mentioned above - "--hive-overwrite    Overwrite existing data in the Hive table."</p></li>
</ol>

<p>"If the Hive table already exists, you can specify the --hive-overwrite option to indicate that existing table in hive must be replaced."</p>

<p>So I tried the below queries separately to get the result:-</p>

<p><code>sqoop import --connect jdbc:mysql://localhost/test --username root --password 'hr' --table sample --hive-import --hive-overwrite --hive-table sqoophive -m 1 --fields-terminated-by '\t' --lines-terminated-by '\n'</code></p>

<p><code>sqoop import --connect jdbc:mysql://localhost/test --username root --password 'hr' --table sample --hive-overwrite --hive-table sqoophive -m 1 --fields-terminated-by '\t' --lines-terminated-by '\n'</code></p>

<p>but rather than replacing the content in the existing table it just created a file in the below path <code>/user/&lt;username&gt;/&lt;mysqltablename&gt;</code></p>

<p>Can somebody please explain me where I am going wrong?</p>