deniskuzZ commented on code in PR #3812:
URL: https://github.com/apache/hive/pull/3812#discussion_r1046820463


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java:
##########
@@ -428,6 +430,11 @@ protected Boolean findNextCompactionAndExecute(boolean 
collectGenericStats, bool
 
         AcidMetricService.updateMetricsFromWorker(ci.dbname, ci.tableName, 
ci.partName, ci.type,
             dir.getCurrentDirectories().size(), dir.getDeleteDeltas().size(), 
conf, msc);
+
+        // Get columns with stats at the end.
+        // This will save computations if compaction has failed.
+        columnList = 
msc.findColumnsWithStats(CompactionInfo.compactionInfoToStruct(ci));

Review Comment:
   Why don't we fetch the column list right before we call 
`statsUpdater.gatherStats`? Also, it is suboptimal to call it always as it's 
not cheap, only when auto-stats is disabled and it's a MAJOR compaction. Maybe 
would be even better to do it in StatsUpdater



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to