ozankabak commented on code in PR #12003: URL: https://github.com/apache/datafusion/pull/12003#discussion_r1720839499
########## datafusion/sqllogictest/test_files/joins.slt: ########## @@ -3898,6 +3898,7 @@ SELECT * FROM ( ) as lhs RIGHT JOIN ( SELECT * from right_table_no_nulls ORDER BY b + LIMIT 10 Review Comment: We can not leave the test as is because the sort in the subquery gets optimized away (rightfully), breaking the intent of the test. These kind of tests seems to be originally written with the assumption that the sort wouldn't be optimized away, and the subquery with ORDER BY was mimicking a table with an order. Placing the limit prevents the optimizer from optimizing the sort away, keeping the intent of the test intact. Keeping the test as is gives us a degenerate test with our new, more powerful optimizer. Once we get `WITH ORDER` support for memory tables, we will simply use a memory table with ordering instead of the subquery and those tests will be reverted back. In the interim, having the LIMIT is the safest (i.e. least test-changing) path forward -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org