kgyrtkirk commented on code in PR #4043:
URL: https://github.com/apache/hive/pull/4043#discussion_r1389344594


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java:
##########
@@ -1916,18 +1916,12 @@ public RelaxedVertexEdgePredicate(EnumSet<EdgeType> 
nonTraverseableEdgeTypes) {
 
     @Override
     public boolean accept(Operator<?> s, Operator<?> t, OpEdge opEdge) {
-      if (!traverseableEdgeTypes.contains(opEdge.getEdgeType())) {
-        return true;
-      }
-      if (s instanceof ReduceSinkOperator) {
-        ReduceSinkOperator rs = (ReduceSinkOperator) s;
-        if (!ParallelEdgeFixer.colMappingInverseKeys(rs).isPresent()) {
-          return true;
-        }
-      }
-      return false;
-    }
+      boolean notTraverseable = 
!traverseableEdgeTypes.contains(opEdge.getEdgeType());
+      boolean notInvertible = (s instanceof ReduceSinkOperator) &&
+          !ParallelEdgeFixer.colMappingInverseKeys((ReduceSinkOperator) 
s).isPresent();
 
+      return notTraverseable || notInvertible;

Review Comment:
   I think its better to not change something which is not broken...
   
   the previous version was eagerly avoiding to call `PEF#colMIK` in case the 
edge type was not matching - what if for some reason it starts throwing 
exceptions for irrelevant cases?
   



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