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

Sergey Shelukhin edited comment on HIVE-20046 at 7/20/18 10:50 PM:
-------------------------------------------------------------------

Confirmed by adding a test that this needs to be removed. TRUNCATE sets 
numFiles to 0, but if it's aborted the check for correct write ID would be 
bypassed.


was (Author: sershe):
Confirmed by adding a test that this needs to be removed. TRUNCATE sets 
numFiles to 0, but stats can still be invalid for specific columns.

> remove NUM_FILES check
> ----------------------
>
>                 Key: HIVE-20046
>                 URL: https://issues.apache.org/jira/browse/HIVE-20046
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>            Priority: Major
>         Attachments: HIVE-20046.01.patch
>
>
> {noformat}
>     // Since newly initialized empty table has 0 for the parameter.
>     if (Long.parseLong(statsParams.get(StatsSetupConst.NUM_FILES)) == 0) {
>       return true;
>     }
> {noformat}
> This doesn't look safe; # of files could be set to 0 by an invalid update, or 
> potentially a parallel update that we cannot see (not sure if this is 
> possible; there's some code in metastore that updates basic stats outside of 
> the scope of the query).
> It would be better to remove this, and see if it breaks some tests. If we do 
> need this, there should be a negative test at some point



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to