You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "SourabhBadhya (via GitHub)" <gi...@apache.org> on 2023/07/10 14:59:33 UTC

[GitHub] [hive] SourabhBadhya commented on a diff in pull request #4440: HIVE-27455: Iceberg: Set COLUMN_STATS_ACCURATE after writing stats for Iceberg tables

SourabhBadhya commented on code in PR #4440:
URL: https://github.com/apache/hive/pull/4440#discussion_r1258399184


##########
ql/src/java/org/apache/hadoop/hive/ql/stats/ColStatsProcessor.java:
##########
@@ -232,6 +241,24 @@ public int persistColumnStats(Hive db, Table tbl) throws HiveException, MetaExce
   public void setDpPartSpecs(Collection<Partition> dpPartSpecs) {
   }
 
+  private void setOrRemoveColumnStatsAccurateProperty(Hive db, TableName tableName, List<String> colNames, boolean success) throws HiveException {
+    if (CollectionUtils.isEmpty(colNames) || !colStatDesc.isTblLevel()) {
+      return;
+    }
+    EnvironmentContext environmentContext = new EnvironmentContext();
+    environmentContext.putToProperties(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE);
+    // Fetch latest table object
+    Table newTable = db.getTable(tableName.getDbTable());
+    // Lowercase all column names.
+    colNames = colNames.stream().map(x -> x.toLowerCase(Locale.ROOT)).collect(Collectors.toList());

Review Comment:
   Modified the array to lowercase without modifying the source. This is done in ColumnStatsDesc. Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org