deniskuzZ commented on a change in pull request #2879:
URL: https://github.com/apache/hive/pull/2879#discussion_r770724374



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -506,10 +478,23 @@ protected Boolean findNextCompactionAndExecute(boolean 
computeStats) {
         task (currently we're using Tez split grouping).
         */
         QueryCompactor queryCompactor = 
QueryCompactorFactory.getQueryCompactor(t, conf, ci);
+        boolean generic_stats = 
conf.getBoolVar(HiveConf.ConfVars.HIVE_COMPACTOR_GATHER_STATS);
+        boolean mr_stats = 
conf.getBoolVar(HiveConf.ConfVars.HIVE_MR_COMPACTOR_GATHER_STATS);
+        boolean computeStats = (queryCompactor == null && (mr_stats || 
generic_stats)) || generic_stats;
+
+        LOG.info("Starting " + ci.type.toString() + " compaction for " + 
ci.getFullPartitionName() + " in " +
+                compactionTxn + " with compute stats set to " + computeStats);
+
+        StatsUpdater su = null;
+        if (computeStats) {
+          su = StatsUpdater.init(ci, conf, runJobAsSelf(ci.runAs) ? ci.runAs : 
t.getOwner(),

Review comment:
       Q. can we refactor StatsUpdater to a service utility that just submits 
the compute stats query and not generate a separate instance per each 
compaction candidate?




-- 
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