asolimando commented on issue #21310: URL: https://github.com/apache/datafusion/issues/21310#issuecomment-4243830816
> In practice the simplest rule is: **skip the rewrite entirely if either branch contains LIMIT**. This matches what PostgreSQL does in its UNION-to-OR rewriter and avoids the subtle non-determinism trap. The complexity of detecting the safe case is high and the payoff is low (the unsafe case is much more common than the safe case). @Whatsonyourmind: I can't find any `UNION-to-OR` rewriter in PostgreSQL (nor similar functions), can you please point exactly to code you have in mind so we can double check the details? Thanks! -- 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]
