okumin commented on code in PR #6244:
URL: https://github.com/apache/hive/pull/6244#discussion_r2771782228


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java:
##########
@@ -2030,6 +2030,18 @@ public Object process(Node nd, Stack<Node> stack, 
NodeProcessorCtx procCtx,
         }
       }
 
+      // NDV=0 means join key statistics are unavailable - fall back to 
joinFactor heuristic
+      if (allSatisfyPreCondition) {
+        for (int pos = 0; pos < parents.size(); pos++) {
+          ReduceSinkOperator parent = (ReduceSinkOperator) 
jop.getParentOperators().get(pos);
+          List<String> keyExprs = 
StatsUtils.getQualifedReducerKeyNames(parent.getConf().getOutputKeyColumnNames());
+          if (!satisfyPrecondition(parent.getStatistics(), keyExprs)) {
+            allSatisfyPreCondition = false;
+            break;
+          }
+        }
+      }

Review Comment:
   @konstantinb Sorry for confusing you. This is a comment for myself. I took a 
glance at this code, and it seems to be OK, but I have not dug into the entire 
semantics of JoinStatsRule. I can't merge an OSS pull request with a very 
optimistic imagination. So, I want to take a deep look again later. I'll write 
this sort of info in my private note next time. Sorry



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