[ https://issues.apache.org/jira/browse/HIVE-8955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223797#comment-14223797 ]
Pankit Thapar commented on HIVE-8955: ------------------------------------- if I insert overwrite into an already existing partition, I see that it does the stats update even when "hive.stats.autogather" is set to false. for example: [hadoop@ip-10-169-146-156 ~]$ hive --hiveconf hive.log.dir=. --hiveconf hive.stats.autogather=false hive> create table test(x string, y string,z string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ","; hive> LOAD DATA LOCAL INPATH './file.txt' OVERWRITE INTO TABLE test; hive> create table test_part(a string) PARTITIONED BY (x string, y string) LOCATION 'my table location'; hive> set hive.exec.dynamic.partition=true; hive> set hive.exec.dynamic.partition.mode=nonstrict; hive> INSERT OVERWRITE TABLE test_part PARTITION (x,y) select x,y,z from test; I see update stats for the last query. > alter partition should check for "hive.stats.autogather" in hiveConf > -------------------------------------------------------------------- > > Key: HIVE-8955 > URL: https://issues.apache.org/jira/browse/HIVE-8955 > Project: Hive > Issue Type: Improvement > Components: Metastore > Affects Versions: 0.13.1 > Reporter: Pankit Thapar > Fix For: 0.15.0 > > > When alter partition code path is triggered, it should check for the flag > "hive.stats.autogather", if it is true, then only updateStats else skip them. > This is done in append_partition code flow. > Is there any specific reason the alter_partition does not respect this conf > variable? > //code snippet : HiveMetastore.java > private Partition append_partition_common(RawStore ms, String dbName, String > tableName, > List<String> part_vals, EnvironmentContext envContext) throws > InvalidObjectException, > AlreadyExistsException, MetaException { > ... > .... > if (HiveConf.getBoolVar(hiveConf, > HiveConf.ConfVars.HIVESTATSAUTOGATHER) && > !MetaStoreUtils.isView(tbl)) { > MetaStoreUtils.updatePartitionStatsFast(part, wh, madeDir); > } > ... > ... > } > The above code snippet checks for the variable but this same check is absent > in > //code snippet : HiveAlterHandler.java > public Partition alterPartition(final RawStore msdb, Warehouse wh, final > String dbname, > final String name, final List<String> part_vals, final Partition > new_part) > throws InvalidOperationException, InvalidObjectException, > AlreadyExistsException, > MetaException { > .... > ... > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)