dtenedor opened a new pull request, #48961: URL: https://github.com/apache/spark/pull/48961
### What changes were proposed in this pull request? This PR extends the Spark SQL grammar to allow an optional trailing comma at the end of SELECT lists, and other named expression lists. This behavior is controlled by the configuration `spark.sql.optionalTrailingCommaInNamedExpressionLists` (`SQLConf.get.OPTIONAL_TRAILING_COMMA_IN_NAMED_EXPRESSION_LISTS`). The new configuration is true by default as of its introduction in this PR. For example, this query was not valid syntax before, but is now: ``` SELECT 1, 2, FROM t ``` ### Why are the changes needed? After deliberation, we decided it was useful to have this support to help with migration from other legacy databases. ### Does this PR introduce _any_ user-facing change? Yes, see above. ### How was this patch tested? This PR adds unit test cases with the configuration enabled and disabled. ### Was this patch authored or co-authored using generative AI tooling? No. -- 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]
