[ 
https://issues.apache.org/jira/browse/HIVE-17001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16076209#comment-16076209
 ] 

Barna Zsombor Klara commented on HIVE-17001:
--------------------------------------------

[~spena] No, the file is not moved outside in the test just renamed from 
000000_0 to 000000_1, it is there in the same partition directory (unless I 
made a typo I'm not seeing right now).

[~ngangam] Yes I made a mistake in the description, the insert should be an 
insert overwrite table, let me correct it. But the behaviour is the same, the 
datafile is not overwritten with insert overwrite either.

> Insert overwrite table doesn't clean partition directory on HDFS if partition 
> is missing from HMS
> -------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-17001
>                 URL: https://issues.apache.org/jira/browse/HIVE-17001
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, Metastore
>            Reporter: Barna Zsombor Klara
>            Assignee: Barna Zsombor Klara
>         Attachments: HIVE-17001.01.patch
>
>
> Insert overwrite table should clear existing data before creating the new 
> data files.
> For a partitioned table we will clean any folder of existing partitions on 
> HDFS, however if the partition folder exists only on HDFS and the partition 
> definition is missing in HMS, the folder is not cleared.
> Reproduction steps:
> 1. CREATE TABLE test( col1 string) PARTITIONED BY (ds string);
> 2. INSERT INTO test PARTITION(ds='p1') values ('a');
> 3. Copy the data to a different folder with different name.
> 4. ALTER TABLE test DROP PARTITION (ds='p1');
> 5. Recreate the partition directory, copy and rename the data file back
> 6. INSERT OVERWRITE TABLE test PARTITION(ds='p1') values ('b');
> 7. SELECT * from test;
> will result in 2 records being returned instead of 1.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to