phillipleblanc opened a new pull request, #10603: URL: https://github.com/apache/datafusion/pull/10603
## Which issue does this PR close? It doesn't close this issue, but is part of the work for #9494 ## Rationale for this change Adds support for turning LogicalPlans that have `Union` LogicalPlans (without distinct, so only `UNION ALL`, not `UNION`) into SQL strings. ## What changes are included in this PR? Splits `select_to_sql` into two parts: `select_to_sql_statement` and `select_to_sql_expr`. LIMIT and ORDER BY are only valid in a statement context, whereas all other plans can appear in a SELECT expression. This allows the parsing for UNION ALL to turn each of its inputs into a SELECT expression, and still respect the LIMIT/ORDER BY at the statement level. ## Are these changes tested? Yes, added two tests to the `roundtrip_sql` integration test. ## Are there any user-facing changes? This expands the valid plans that can be unparsed back to SQL strings, and is backwards compatible. -- 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