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


##########
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:
   @okumin I am unsure I fully understand this comment, could you please 
provide more info?



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