peter-toth commented on code in PR #11357:
URL: https://github.com/apache/datafusion/pull/11357#discussion_r1674184290


##########
datafusion/sqllogictest/test_files/cse.slt:
##########
@@ -171,3 +175,41 @@ logical_plan
 physical_plan
 01)ProjectionExec: expr=[a@0 = random() AND b@1 = 0 as c1, a@0 = random() AND 
b@1 = 1 as c2, a@0 = 2 + random() OR b@1 = 4 as c3, a@0 = 2 + random() OR b@1 = 
5 as c4, CASE WHEN a@0 = 4 + random() THEN 0 ELSE 1 END as c5, CASE WHEN a@0 = 
4 + random() THEN 0 ELSE 2 END as c6]
 02)--MemoryExec: partitions=1, partition_sizes=[0]
+

Review Comment:
   This is a good idea! I forgot about negative tests. But from the first and 
3rd case when examples above we can extract `a + 10` as it appears in the first 
when, so it is surely executed, and it also appear in the conditional subtrees.
   I've added new tests in 
https://github.com/apache/datafusion/pull/11357/commits/6e3300f4416f1dfb4beb6d6fffb10a631447a826.



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