Indhumathi27 commented on code in PR #6202:
URL: https://github.com/apache/hive/pull/6202#discussion_r2669025866


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/LimitPushdownOptimizer.java:
##########
@@ -250,8 +255,12 @@ private static class LimitPushdownContext implements 
NodeProcessorCtx {
 
     private final float threshold;
 
+    private final boolean disallowRSCopy;
+
     public LimitPushdownContext(HiveConf conf) throws SemanticException {
       threshold = 
conf.getFloatVar(HiveConf.ConfVars.HIVE_LIMIT_PUSHDOWN_MEMORY_USAGE);
+      disallowRSCopy = 
conf.getBoolVar(HiveConf.ConfVars.HIVE_OPTIMIZE_TOPNKEY) &&
+              !conf.getBoolVar(HiveConf.ConfVars.HIVE_MAPSIDE_AGGREGATE);

Review Comment:
   For query: `select value, sum(key) as sum from src group by value order by 
value limit 20;`
   
   when hive.map.aggr is true, tree stack has GBY[2] - RS[3] - GBY[4] - RS[6]
   
   when hive.map.aggr is false, tree stack has RS[2] - GBY[2] - RS[5]
   RS[2] here is Reduce output operator
   Without patch: TopNkey will be applied for both operators.
   With patch: TopNkey will be applied only to RS[5] operator. 
   
   There is no impact without this changes as well. RS[2] will have some of 
configurations set, which comes in explain plan.
   



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