Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/16326
  
    Instead of appending the new rows, Hive will overwrite the previous files 
in the specified location, even if we are using `INSERT INTO`. See the output
    ```
    hive> create table test(c1 string) partitioned by (p1 string);
    hive> desc formatted test;
    ...
    Location:                   file:/user/hive/warehouse/test   
    Table Type:                 MANAGED_TABLE            
    ...
    hive> create table newTab (c1 string) partitioned by (p1 string) location 
'/user/hive/warehouse/test';
    hive> insert overwrite table test partition (p1='a') select 'bla';
    hive> select * from test;
    OK
    bla a
    Time taken: 0.097 seconds, Fetched: 1 row(s)
    hive> select * from newTab;
    OK
    Time taken: 0.076 seconds
    hive> insert into table newTab partition (p1='a') select 'c';
    Moving data to directory 
file:/user/hive/warehouse/test/p1=a/.hive-staging_hive_2016-12-18_07-47-16_045_3942279594280072795-1/-ext-10000
    Loading data to table default.newtab partition (p1=a)
    hive> select * from newTab;
    OK
    c   a
    Time taken: 0.077 seconds, Fetched: 1 row(s)
    hive> select * from test;
    OK
    c   a
    Time taken: 0.055 seconds, Fetched: 1 row(s)
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to