[ https://issues.apache.org/jira/browse/HIVE-16171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966335#comment-15966335 ]
Sankar Hariappan commented on HIVE-16171: ----------------------------------------- Hi [~ekoifman], For this truncate table support with change management, there are few changes done to update the table stats. Could you please have a look at it? I shall see couple of test failures due to this change where the result-logs have differences. But, I believe, the new code is fine and the result file should be updated for these 2 failed tests. Please give your opinion if I'm wrong. Brief description of my change: Base: 1. Update Stats (RowNum=0, NumOfFiles=0 etc). 2. AlterTable with new Stats. -- This effectively regenerate the stats from the table again and hence set to older values. 3. TruncateTable (Trash data files) New Code: 1. TruncateTable (Trash data files) 2. Update Stats (RowNum=0, NumOfFiles=0 etc). 3. AlterTable with new Stats. This was tested and is working fine. cc: [~thejas], [~sushanth] > Support replication of truncate table > ------------------------------------- > > Key: HIVE-16171 > URL: https://issues.apache.org/jira/browse/HIVE-16171 > Project: Hive > Issue Type: Sub-task > Components: repl > Affects Versions: 2.1.0 > Reporter: Sankar Hariappan > Assignee: Sankar Hariappan > Labels: DR > Attachments: HIVE-16171.01.patch, HIVE-16171.02.patch, > HIVE-16171.03.patch, HIVE-16171.04.patch, HIVE-16171.05.patch > > > Need to support truncate table for replication. Key points to note. > 1. For non-partitioned table, truncate table will remove all the rows from > the table. > 2. For partitioned tables, need to consider how truncate behaves if truncate > a partition or the whole table. > 3. Bootstrap load with truncate table must work as it is just > loadTable/loadPartition with empty dataset. > 4. It is suggested to re-use the alter table/alter partition events to handle > truncate. > 5. Need to consider the case where insert event happens before truncate table > which needs to see their data files through change management. The data files > should be recycled to the cmroot path before trashing it. -- This message was sent by Atlassian JIRA (v6.3.15#6346)