difin commented on code in PR #4855:
URL: https://github.com/apache/hive/pull/4855#discussion_r1423002504


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java:
##########
@@ -260,8 +187,9 @@ protected Boolean findNextCompactionAndExecute(boolean 
collectGenericStats, bool
     String workerMetric = null;
 
     CompactionInfo ci = null;
-    boolean computeStats = false;
     Table table = null;
+    boolean compactionResult = false;
+    CompactionExecutor compactionExecutor = null;

Review Comment:
   Because Table initialization happens inside a try-catch block and is used 
outside of the try-catch. Initially I thought to create instance members 
instead of local variables, but then this code would break if Worker's method 
findNextCompactionAndExecute() is called to compact 2 tables in parallel. Same 
with other local variables in this method
   
   ```
       String workerMetric = null;
       CompactionInfo ci = null;
       Table table = null;
       CompactionExecutor compactionExecutor = null;
       boolean compactionResult = false;
   ```



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