alamb commented on code in PR #23615:
URL: https://github.com/apache/datafusion/pull/23615#discussion_r3590729874


##########
datafusion/sqllogictest/test_files/simplify_expr.slt:
##########
@@ -146,3 +146,57 @@ logical_plan
 physical_plan
 01)ProjectionExec: expr=[column1@0 = 1 as opt1, column1@0 = 2 AND column1@0 != 
2 as noopt1, column1@0 = 4 as opt2, column1@0 != 5 AND column1@0 = 5 as noopt2]
 02)--DataSourceExec: partitions=1, partition_sizes=[1]
+

Review Comment:
   I took the liberty of adding some slt coverage for this feature too



##########
datafusion/sqllogictest/test_files/simplify_expr.slt:
##########
@@ -146,3 +146,57 @@ logical_plan
 physical_plan
 01)ProjectionExec: expr=[column1@0 = 1 as opt1, column1@0 = 2 AND column1@0 != 
2 as noopt1, column1@0 = 4 as opt2, column1@0 != 5 AND column1@0 = 5 as noopt2]
 02)--DataSourceExec: partitions=1, partition_sizes=[1]
+

Review Comment:
   These fail like this on main
   
   ```diff
   warning: `datafusion-sqllogictest` (test "sqllogictests") generated 1 warning
       Finished `ci` profile [unoptimized] target(s) in 1m 45s
        Running bin/sqllogictests.rs 
(target/ci/deps/sqllogictests-01bd002bb437dcb6)
   Running with 16 test threads (available parallelism: 16)
   Completed 493 test files in 6 seconds                                        
                                                  External error: 2 errors in 
file 
/Users/andrewlamb/Software/datafusion/datafusion/sqllogictest/test_files/simplify_expr.slt
   
   1. query result mismatch:
   [SQL] explain select * from t1 join t2 on t1.a = t2.b or t2.b = t1.a;
   [Diff] (-expected|+actual)
       logical_plan
   -   01)Inner Join: t1.a = t2.b
   +   01)Inner Join:  Filter: t1.a = t2.b OR t2.b = t1.a
       02)--TableScan: t1 projection=[a]
       03)--TableScan: t2 projection=[b]
       physical_plan
   -   01)HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(a@0, b@0)]
   +   01)NestedLoopJoinExec: join_type=Inner, filter=a@0 = b@1 OR b@1 = a@0
       02)--DataSourceExec: partitions=1, partition_sizes=[1]
       03)--DataSourceExec: partitions=1, partition_sizes=[1]
   at 
/Users/andrewlamb/Software/datafusion/datafusion/sqllogictest/test_files/simplify_expr.slt:162
   
   
   2. query result mismatch:
   [SQL] explain select * from t1 join t2 on t1.a > t2.b and (t1.a + t2.b > 1 
or t2.b + t1.a > 1);
   [Diff] (-expected|+actual)
       logical_plan
   -   01)Inner Join:  Filter: t1.a > t2.b AND t1.a + t2.b > Int32(1)
   +   01)Inner Join:  Filter: t1.a > t2.b AND (t1.a + t2.b > Int32(1) OR t2.b 
+ t1.a > Int32(1))
       02)--TableScan: t1 projection=[a]
       03)--TableScan: t2 projection=[b]
       physical_plan
   -   01)NestedLoopJoinExec: join_type=Inner, filter=a@0 > b@1 AND a@0 + b@1 > 
1
   +   01)NestedLoopJoinExec: join_type=Inner, filter=a@0 > b@1 AND (a@0 + b@1 
> 1 OR b@1 + a@0 > 1)
       02)--DataSourceExec: partitions=1, partition_sizes=[1]
       03)--DataSourceExec: partitions=1, partition_sizes=[1]
   at 
/Users/andrewlamb/Software/datafusion/datafusion/sqllogictest/test_files/simplify_expr.slt:181
   
   
   ```



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