xiedeyantu commented on issue #21310: URL: https://github.com/apache/datafusion/issues/21310#issuecomment-4186175262
@Whatsonyourmind Thank you very much for your follow-up! To address your point: the scenario you described would actually not be rewritten under my current PR. Since the subqueries in the UNION contain different filters—S`ORT-FILTER (a=1)` and `SORT-FILTER (b=2)`—they are not considered to have the same origin. Therefore, the case you mentioned is safe. However, you've raised a great point. If the SQL were written as: ``` (SELECT mgr, comm FROM emp LIMIT 2) UNION (SELECT mgr, comm FROM emp LIMIT 2) ``` This specific scenario would indeed require a restriction, and I will be working on a fix for this. I’d love for you to review the PR if you’re interested! -- 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]
