jayzhan211 commented on code in PR #25074: URL: https://github.com/apache/datafusion/pull/25074#discussion_r3999097324
########## datafusion/sqllogictest/test_files/union.slt: ########## @@ -349,6 +383,43 @@ SELECT id, name FROM t1 WHERE id = 1 UNION SELECT id, name FROM t1 WHERE id = 2 1 Alex 2 Bob +# Regression: different computed projections below the branch filters must +# preserve both values when unions_to_filter is enabled. +query I rowsort +SELECT prices.amount +FROM (SELECT amount + 100 AS amount FROM prices) AS prices +WHERE amount > 0 +UNION +SELECT prices.amount +FROM (SELECT amount + 200 AS amount FROM prices) AS prices +WHERE amount > 1 +---- +1100 +1200 + +# Regression: predicates qualified with a table alias must still resolve +# against the source below the merged filter. +query I rowsort +SELECT x.id FROM t1 AS x WHERE x.id = 1 +UNION +SELECT x.id FROM t1 AS x WHERE x.id = 2 Review Comment: It would be nice to add another explain plan to show the plan -- 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]
