<?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: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157806#M49094</link>
    <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/14949/reddyppr.html"&gt;@Praveen PentaReddy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for submitting the JIRA ticket. I reviewed Artem's response and it seems that until the enhancement is implemented, his response is still the best option as of right now.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2016 04:10:07 GMT</pubDate>
    <dc:creator>cstanca</dc:creator>
    <dc:date>2016-12-21T04:10:07Z</dc:date>
    <item>
      <title>HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157788#M49076</link>
      <description />
      <pubDate>Fri, 16 Dec 2016 14:45:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157788#M49076</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-16T14:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157789#M49077</link>
      <description>&lt;P&gt;it's easier to drop a table and recreate, delete from a table and truncate are not supported by API&lt;/P&gt;&lt;PRE&gt;set hcat.bin /usr/bin/hcat;
sql drop table if exists codes;
sql create table codes(code string, description string, total_emp int, salary int);
a = load 'sample_07' using org.apache.hive.hcatalog.pig.HCatLoader();
b = load 'sample_08' using org.apache.hive.hcatalog.pig.HCatLoader();
c = join b by code, a by code;d = foreach c generate $0 as code, $1 as description, $2 as total_emp, $3 as salary;
store d into 'codes' using org.apache.hive.hcatalog.pig.HCatStorer();&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 14:50:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157789#M49077</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-16T14:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157790#M49078</link>
      <description>&lt;P&gt;Thanks for you response, The above code is writing back the data to another table after the transformation.however, i don't want to delete the data/ drop the table and i want to overwrite the same table after my transformation in pig. &lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 14:55:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157790#M49078</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-16T14:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157791#M49079</link>
      <description>&lt;P&gt;then you need a temporary table to store the intermediary data. This is ugly but works, there's probably a better way but it's late where I am &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;set hcat.bin /usr/bin/hcat;
a = load 'codes' using org.apache.hive.hcatalog.pig.HCatLoader();
b = foreach a generate $0 as code, $1 as description, $2 as total_emp, $3 as salary;
sql drop table if exists codes_temp;
sql create table codes_temp(code string, description string, total_emp int, salary int);
store b into 'codes_temp' using org.apache.hive.hcatalog.pig.HCatStorer();
sql drop table if exists codes;
sql create table codes(code string, description string, total_emp int, salary int);
c = load 'codes_temp' using org.apache.hive.hcatalog.pig.HCatLoader();
d = foreach c generate $0 as code, $1 as description, $2 as total_emp, $3 as salary;
store d into 'codes' using org.apache.hive.hcatalog.pig.HCatStorer();
sql drop table if exists codes_temp;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 15:16:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157791#M49079</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-16T15:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157792#M49080</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14949/reddyppr.html" nodeid="14949"&gt;@Praveen PentaReddy&lt;/A&gt; I think I understand what you mean now, you may have run into a bug. What version of Pig and HCatalog are you running? I just tested on Sandbox with HDP 2.5 and it works&lt;/P&gt;&lt;PRE&gt;set hcat.bin /usr/bin/hcat;
a = load 'codes' using org.apache.hive.hcatalog.pig.HCatLoader();
b = foreach a generate $0 as code, $1 as description, $2 as total_emp, $3 as salary;
store b into 'codes' using org.apache.hive.hcatalog.pig.HCatStorer();
&lt;/PRE&gt;&lt;P&gt;my codes table contained 823 rows, after this execution, it contains 1646 as expected&lt;/P&gt;&lt;P&gt;per hcatalog wiki&lt;/P&gt;&lt;P&gt;You can write to a non-partitioned table simply by using HCatStorer. The contents of the table will be overwritten:&lt;/P&gt;&lt;PRE&gt;store z into 'web_data' using org.apache.hive.hcatalog.pig.HCatStorer();&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/HCatalog+LoadStore#HCatalogLoadStore-HCatStorer" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/HCatalog+LoadStore#HCatalogLoadStore-HCatStorer&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 15:26:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157792#M49080</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-16T15:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157793#M49081</link>
      <description>&lt;P&gt;Thanks for your replay.&lt;/P&gt;&lt;P&gt;Should i need to add the first step(set command  bin/hcat) every time when i launch Hcat.&lt;/P&gt;&lt;P&gt;I am using Hadoop 2.7.1.2.4.2.0-258 (version)&lt;/P&gt;&lt;P&gt;Apache Pig version 0.15.0.2.4.2.0-258 (rexported)  - verison&lt;/P&gt;&lt;P&gt;Hive 1.2.1000.2.4.2.0-258 - version,&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 23:56:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157793#M49081</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-16T23:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157794#M49082</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/14949/reddyppr.html" nodeid="14949"&gt;@Praveen PentaReddy&lt;/A&gt;&lt;P&gt;that's interesting, do you have another environment to test your script on? Like I said I have no issues on my end. The answer to your question about set command, I answered that in the following thread &lt;A href="https://community.hortonworks.com/questions/1954/hcatbin-is-not-defined-define-it-to-be-your-hcat-s.html"&gt;https://community.hortonworks.com/questions/1954/hcatbin-is-not-defined-define-it-to-be-your-hcat-s.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If my answer was useful and resolved your issue, please accept it as best.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 00:08:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157794#M49082</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-17T00:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157795#M49083</link>
      <description>&lt;P&gt;Yaah.. i have another version and let me know test on it and will get back with you with the result.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 00:13:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157795#M49083</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-17T00:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157796#M49084</link>
      <description>&lt;P&gt;Per your last conversation it looks like HcatStorer is not overwriting the data, rather it is appending the data.&lt;/P&gt;&lt;P&gt;In your last test, you were having the record count of 823 before the transformation and after the transformation you stored back the results and the result count is 1646.(which is nothing but appending the data).&lt;/P&gt;&lt;P&gt;My expectations are below.&lt;/P&gt;&lt;P&gt;Read the records of 823 and do transformation on it and update back the result and once updated the result count should be 823(overwriting the data with new transformation data) and not 1643.&lt;/P&gt;&lt;P&gt;Is this kind of overwriting the data is possible through HCatStorer ? if not is there any other alternatives ways of overwriting the data in pig ( Eg :- PigStorage or any other functions).&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 02:29:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157796#M49084</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-17T02:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157797#M49085</link>
      <description>&lt;P&gt;Any Help highly appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 06:19:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157797#M49085</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-17T06:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157798#M49086</link>
      <description>&lt;P&gt;Is my workaround with a temporary table not good enough for your use case? Save output of your transformation to a temp table, drop and create your original table and save your temp result back.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 11:25:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157798#M49086</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-17T11:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157799#M49087</link>
      <description>&lt;P&gt;I think that's the only solution i think is the best at the moment using temporary table. Does Overwrite exists in Pig? Like Hive Overwrite table data.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Dec 2016 13:44:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157799#M49087</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-18T13:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157800#M49088</link>
      <description>&lt;P&gt;According to the wiki it exists but in our mutual tests, we were not able to fit your use case. Perhaps you'd like to open an enhancement Jira. I do like integration of Pig and HCatalog though I would argue instead of spending hours to figure it out, consider looking into Spark as it's under a heavy development and benefits from a wider community. If my workaround fits your needs, please consider accepting my answer as best.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 01:11:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157800#M49088</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-19T01:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157801#M49089</link>
      <description>&lt;P&gt;Yes, This is testing only and i am doing it out of my curiosity. Thanks you very much for your valuable responses.&lt;/P&gt;&lt;P&gt;Could you let me know how to open an enhancement Jira request ?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:30:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157801#M49089</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-20T04:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157802#M49090</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14949/reddyppr.html" nodeid="14949"&gt;@Praveen PentaReddy&lt;/A&gt; create an Apache Jira account and open a ticket on &lt;A href="https://issues.apache.org/jira/browse/pig/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel" target="_blank"&gt;https://issues.apache.org/jira/browse/pig/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel&lt;/A&gt; apache pig jira page.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:33:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157802#M49090</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-20T04:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157803#M49091</link>
      <description>&lt;P&gt;Thanks, i have raised an enhancement Jira.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:58:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157803#M49091</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-20T04:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157804#M49092</link>
      <description>&lt;P&gt;Can you paste a link to your Jira and accept my answer as workaround. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 08:44:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157804#M49092</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-20T08:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157805#M49093</link>
      <description>&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/PIG-5079" target="_blank"&gt;https://issues.apache.org/jira/browse/PIG-5079&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 02:28:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157805#M49093</guid>
      <dc:creator>PentaReddy</dc:creator>
      <dc:date>2016-12-21T02:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157806#M49094</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/14949/reddyppr.html"&gt;@Praveen PentaReddy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for submitting the JIRA ticket. I reviewed Artem's response and it seems that until the enhancement is implemented, his response is still the best option as of right now.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 04:10:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157806#M49094</guid>
      <dc:creator>cstanca</dc:creator>
      <dc:date>2016-12-21T04:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: HCatStorer is not overwriting a Hive table. or How to overwrite a hive table using HCatStorer ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157807#M49095</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14949/reddyppr.html" nodeid="14949"&gt;@Praveen PentaReddy&lt;/A&gt; &lt;/P&gt;&lt;P&gt;to close the loop on this, turns out append is the default behavior and if you read the comments in &lt;A href="https://issues.apache.org/jira/browse/HIVE-6897"&gt;https://issues.apache.org/jira/browse/HIVE-6897&lt;/A&gt; you can see that it is not advisable to force an overwrite of a table via HCatalog. So to turn the feature off completely and not promote "bad" behavior I did the following&lt;/P&gt;&lt;PRE&gt;grunt&amp;gt; sql alter table codeZ set TBLPROPERTIES ('immutable' = 'true');
2016-12-29 20:49:51,924 [main] INFO  org.apache.pig.tools.grunt.GruntParser - Going to run hcat command: alter table codeZ set TBLPROPERTIES ('immutable' = 'true');
OK
Time taken: 2.041 seconds
grunt&amp;gt; a = load 'sample_07' using org.apache.hive.hcatalog.pig.HCatLoader();
2016-12-29 20:51:00,125 [main] INFO  hive.metastore - Trying to connect to metastore with URI thrift://sandbox.hortonworks.com:9083
2016-12-29 20:51:00,163 [main] INFO  hive.metastore - Connected to metastore.
grunt&amp;gt; b = load 'sample_08' using org.apache.hive.hcatalog.pig.HCatLoader();
grunt&amp;gt; c = join b by code, a by code;
grunt&amp;gt; d = foreach c generate $0 as code, $1 as description, $2 as total_emp, $3 as salary;
grunt&amp;gt; store d into 'codeZ' using org.apache.hive.hcatalog.pig.HCatStorer();
2016-12-29 20:52:26,894 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 6000:
&amp;lt;line 5, column 0&amp;gt; Output Location Validation Failed for: 'codeZ More info to follow:
org.apache.hive.hcatalog.common.HCatException : 2003 : Non-partitioned table already contains data : default.codez
Details at logfile: /home/guest/pig_1483044536026.log
grunt&amp;gt; quit
2016-12-29 20:56:25,336 [main] INFO  org.apache.pig.Main - Pig script completed in 7 minutes, 29 seconds and 397 milliseconds (449397 ms)
[guest@sandbox ~]$ less /home/guest/pig_1483044536026.log

&lt;/PRE&gt;&lt;P&gt;and snippet from log&lt;/P&gt;&lt;PRE&gt;ERROR 6000:
&amp;lt;line 5, column 0&amp;gt; Output Location Validation Failed for: 'codeZ More info to follow:
org.apache.hive.hcatalog.common.HCatException : 2003 : Non-partitioned table already contains data : default.codez


org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1002: Unable to store alias d
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1778)
        at org.apache.pig.PigServer.registerQuery(PigServer.java:707)
        at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:1075)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:505)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:231)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:206)
        at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:66)
        at org.apache.pig.Main.run(Main.java:566)
        at org.apache.pig.Main.main(Main.java:178)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
Caused by: org.apache.pig.impl.plan.VisitorException: ERROR 6000:
&amp;lt;line 5, column 0&amp;gt; Output Location Validation Failed for: 'codeZ More info to follow:
org.apache.hive.hcatalog.common.HCatException : 2003 : Non-partitioned table already contains data : default.codez
        at org.apache.pig.newplan.logical.visitor.InputOutputFileValidatorVisitor.visit(InputOutputFileValidatorVisitor.java:95)
        at org.apache.pig.newplan.logical.relational.LOStore.accept(LOStore.java:66)
        at org.apache.pig.newplan.DepthFirstWalker.depthFirst(DepthFirstWalker.java:64)
        at org.apache.pig.newplan.DepthFirstWalker.depthFirst(DepthFirstWalker.java:66)
        at org.apache.pig.newplan.DepthFirstWalker.depthFirst(DepthFirstWalker.java:66)
        at org.apache.pig.newplan.DepthFirstWalker.depthFirst(DepthFirstWalker.java:66)
        at org.apache.pig.newplan.DepthFirstWalker.walk(DepthFirstWalker.java:53)
        at org.apache.pig.newplan.PlanVisitor.visit(PlanVisitor.java:52)
        at org.apache.pig.newplan.logical.relational.LogicalPlan.validate(LogicalPlan.java:212)
        at org.apache.pig.PigServer$Graph.compile(PigServer.java:1851)
        at org.apache.pig.PigServer$Graph.access$300(PigServer.java:1527)
        at org.apache.pig.PigServer.execute(PigServer.java:1440)
        at org.apache.pig.PigServer.access$500(PigServer.java:118)
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1773)
        ... 14 more
Caused by: org.apache.hive.hcatalog.common.HCatException : 2003 : Non-partitioned table already contains data : default.codez
        at org.apache.hive.hcatalog.mapreduce.FileOutputFormatContainer.handleDuplicatePublish(FileOutputFormatContainer.java:206)
        at org.apache.hive.hcatalog.mapreduce.FileOutputFormatContainer.checkOutputSpecs(FileOutputFormatContainer.java:121)
        at org.apache.hive.hcatalog.mapreduce.HCatBaseOutputFormat.checkOutputSpecs(HCatBaseOutputFormat.java:65)
        at org.apache.pig.newplan.logical.visitor.InputOutputFileValidatorVisitor.visit(InputOutputFileValidatorVisitor.java:69)

&lt;/PRE&gt;&lt;P&gt;in other words, it is not advisable to overwrite via HCatStorer as Hive handles append/overwrite. The only workaround here is to use a temporary table as I suggested earlier.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 05:00:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HCatStorer-is-not-overwriting-a-Hive-table-or-How-to/m-p/157807#M49095</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-12-30T05:00:16Z</dc:date>
    </item>
  </channel>
</rss>

