jcamachor commented on a change in pull request #630: HIVE-21365
URL: https://github.com/apache/hive/pull/630#discussion_r284941789
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
 ##########
 @@ -63,20 +66,16 @@
  */
 public class HiveAggregateJoinTransposeRule extends AggregateJoinTransposeRule 
{
 
-  /** Extended instance of the rule that can push down aggregate functions. */
-  public static final HiveAggregateJoinTransposeRule INSTANCE =
-      new HiveAggregateJoinTransposeRule(HiveAggregate.class, HiveJoin.class,
-          HiveRelFactories.HIVE_BUILDER, true);
+  private static final Logger LOG = 
LoggerFactory.getLogger(HiveAggregateJoinTransposeRule.class);
 
   private final boolean allowFunctions;
+  private final AtomicInteger noColsMissingStats;
 
 Review comment:
   We have always captured how many columns have missing stats (this is same as 
previous behavior, observe that this variable is coming from CalcitePlanner and 
it is used in other places, e.g., ```RelOptHiveTable``` has a reference to it). 
The change here is that since we trigger all rules using a single planner, we 
cannot capture the stats exception from outside of the rule, and we need to 
rather do it from within the rule logic. That is why it is passed as a 
parameter.
   About AtomicInteger vs other type, I do think this is shared by multiple 
threads indeed, but I suspect this was done because Boolean/Integer are 
immutable, hence instead of passing a reference to the planner and changing the 
object itself, you pass around the AtomicInteger that is not immutable.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to