afs commented on code in PR #1631:
URL: https://github.com/apache/jena/pull/1631#discussion_r1030516768


##########
jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/TransformFilterImplicitJoin.java:
##########
@@ -120,10 +120,14 @@ private static Op apply(ExprList exprs, Op subOp) {
         // ---- Check if the subOp is the right shape to transform.
         Op op = subOp;
 
-        // Special case : deduce that the filter will always "eval unbound"
-        // hence eliminate all rows. Return the empty table.
+        // LATERAL : This is not longer true.
+//        // Special case : deduce that the filter will always "eval unbound"
+//        // hence eliminate all rows. Return the empty table.
+//        if (testSpecialCaseUnused(subOp, joins, remaining))
+//            return OpTable.empty();
+        // But simply skipping this causes (filter) to become (assign) which 
fails as (assign) does not handle errors.
         if (testSpecialCaseUnused(subOp, joins, remaining))
-            return OpTable.empty();
+            return null;

Review Comment:
   Query timeouts will catch that (we hope).
   
   EXISTS uses the same injection of bindings as JENA-500 except it does it 
dynamically at runtime (like LATERAL - EXIST is the ASK version of LATERAL). 
Whether that's the current iffy form or the better one written up.
   
   It's is less likely to occur in EXISTS due to usage but it is possible. And 
like LATERAL, complicated because it may be bound sometimes and not others.
   
   Can we merge as-is which is functionally safe?
   
   ---
   
   I'm still mystified by `TestSemanticEquivalence.implicitJoinEvaluation3`.
   
   Maybe the test is wrong and comparing to zero happens for the wrong reasons 
but I can't see a difference to the algebra sub-tests.
   
   



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