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


##########
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:
   > Is there any pointers as to when it has been beneficial?
   
   If memory serves this particular piece originated because of users.  This 
originated when I was at Cray and occasionally we'd see users make simple typos 
in their queries, especially around variable names, that would cause the engine 
to do a lot of work it later just threw away due to the bad filter clause so 
this was basically a case of protecting users from themselves
   
   So we'd get a bug of the form "Why does my query take ages and return 
nothing?" where the returning nothing was due to user error.  By spotting these 
cases in the optimiser we could return nothing much faster, and generally the 
users figured out the typo themselves in that case because there weren't 
distracted by the slow performance



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