aharpervc opened a new pull request, #1949: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1949
This PR is a followup ([ref](https://github.com/apache/datafusion-sqlparser-rs/pull/1937#issuecomment-3070806780)) to recent work on parsing without requiring semicolon statement delimiters. It's the same content as [my former PR](https://github.com/apache/datafusion-sqlparser-rs/pull/1843) which was stale after https://github.com/apache/datafusion-sqlparser-rs/pull/1937. This PR is rebased on latest master and brings forward the increased test coverage and additional parsing fixes from the previous branch. Particularly, this PR expands support as follows: 1. Added a `supports_statements_without_semicolon_delimiter` dialect trait function (default false, but true for SQL Server). Now we can set the default parser option based on the dialect 2. Tightened up parsing logic, such as for when something is an alias or a keyword and comma delimited lists. When you write T-SQL without semicolons, you're going to have ambiguities, but being more selective here in the parser seems reasonable 3. More test coverage & expanded test helper functions: `statements_without_semicolons_parse_to` which deletes semicolons from the string, then parses it (simplifies testing parsing with & without), `all_dialects_requiring_semicolon_statement_delimiter` & `all_dialects_not_requiring_semicolon_statement_delimiter` to find configured dialects, and `assert_err_parse_statements` to simplify asserting "end of statement" vs "an SQL statement" errors. A lot of test assertions that fail when requiring semicolons also fail when not requiring semicolons, but what precisely the parser will complain about could be different (again, if you write SQL this way, you accept that possibility). The helper functions enable running existing tests on dialects that don't require semicolons with minimal changes. The main usage there is in the "common" tests. -- 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