aharpervc commented on PR #1809: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1809#issuecomment-2894713954
> Not sure I necessarily agree with this sentiment. I think if there are constructs in a file that arent sql constructs, they should be stripped off from the file before parsing to the library. Parsing non-sql constructs would be out of scope for this library. I actually agree with your perspective here. The central question is, "is the `go` batch delimiter found in SQL files 'a SQL construct' or not"? (Then we have a separate question on the implementation, which is the options list I suggested above). For illustration, something I think we'd both agree is _not_ a SQL construct & therefore _not_ appropriate for this parse is [Template Syntax](https://learn.microsoft.com/en-us/ssms/template/templates-ssms). That seems pretty clearly something that should be filled in prior to expecting a SQL document to parse. For `go`, here's what I can say: | evidence | a SQL construct | not a SQL construct | |---|---|---| | [documented as a "statement" alongside other SQL statements](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go) & indistinguishable from a statement in code | ✅ | | | documented as ["commands that are not Transact-SQL statements"](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go) & "GO is not a Transact-SQL statement" | | ✅ | | [SQL Server's ManagedBatchParser parses it](https://learn.microsoft.com/en-us/dotnet/api/managedbatchparser.parser.setbatchdelimiter?view=sqlserver-2016) (actually, configurable (!)) | ✅ | | | Apps need to parse SQL to find `go`'s (this library or another) | ✅ | ✅ | -- 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