[ https://issues.apache.org/jira/browse/HIVE-20143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540710#comment-16540710 ]
Sergey Shelukhin commented on HIVE-20143: ----------------------------------------- cc [~jcamachorodriguez] [~ashutoshc] I don't if we care much about this scenario. Could affect CBO if after truncate, the stats are never accurate. > analyze doesn't mark partition column stats as accurate after truncate > ---------------------------------------------------------------------- > > Key: HIVE-20143 > URL: https://issues.apache.org/jira/browse/HIVE-20143 > Project: Hive > Issue Type: Bug > Reporter: Sergey Shelukhin > Priority: Major > > Discovered while looking at txn stats. This works fine for truncate+analyze > for non-partitioned tables, but not for partitions: > {noformat} > set hive.stats.dbclass=fs; > set hive.stats.fetch.column.stats=true; > set hive.stats.autogather=true; > set hive.stats.column.autogather=true; > set hive.compute.query.using.stats=true; > set hive.mapred.mode=nonstrict; > set hive.explain.user=false; > set hive.fetch.task.conversion=none; > set hive.query.results.cache.enabled=false; > create table stats_part1(key int,value string) partitioned by (p int); > insert into table stats_part1 partition(p=101) values (1, "foo"); > insert into table stats_part1 partition(p=102) values (2, "bar"); > explain select count(key) from stats_part1; -- from stats > truncate table stats_part1 partition(p=101); > explain select count(key) from stats_part1; -- not from stats, ok > analyze table stats_part1 partition(p) compute statistics for columns; > explain select count(key) from stats_part1; -- not from stats still > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)