You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "LucaCappelletti94 (via GitHub)" <gi...@apache.org> on 2026/10/17 20:03:20 UTC
[PR] MsSql: Keep the comma separator when displaying DECLARE lists [datafusion-sqlparser-rs]
LucaCappelletti94 opened a new pull request, #2671:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2671
In MsSql one `DECLARE` keyword takes a comma-separated list of declarations, `DECLARE @a INT, @b INT` (https://learn.microsoft.com/en-us/sql/t-sql/language-elements/declare-local-variable-transact-sql). The parser collected the list into one `Statement::Declare`, but the display joined it with `; `, so the statement was printed back as `DECLARE @a INT; @b INT`, which T-SQL reads as a different statement.
`Statement::Declare` gains a `separator: DeclareSeparator` field. The MsSql parser records `Comma`, and the Snowflake, BigQuery and cursor forms record `Semicolon`, matching Snowflake Scripting's `DECLARE` section where each declaration ends with `;` (https://docs.snowflake.com/en/sql-reference/snowflake-scripting/declare).
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] MsSql: Keep the comma separator when displaying DECLARE lists [datafusion-sqlparser-rs]
Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 merged PR #2671:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2671
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] MsSql: Keep the comma separator when displaying DECLARE lists [datafusion-sqlparser-rs]
Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 commented on code in PR #2671:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2671#discussion_r4329027176
##########
tests/sqlparser_mssql.rs:
##########
@@ -3004,3 +3006,10 @@ fn parse_create_proc() {
.expect_err("PROC should remain MSSQL-specific");
ms_and_generic().verified_stmt("SELECT proc FROM jobs");
}
+
+#[test]
+fn parse_mssql_declare_comma_list_display() {
Review Comment:
I did not add one because it is already present in several other tests as part of the existing syntax. It does not have a dedicated test.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] MsSql: Keep the comma separator when displaying DECLARE lists [datafusion-sqlparser-rs]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2671:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2671#issuecomment-6240130227
## [Codecov](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/pull/2671?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 81.26%. Comparing base ([`1aabd12`](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/commit/1aabd12d12234de55b27f658add789eed1eaaa5c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`b634c00`](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/commit/b634c00e6d8a26e4976698fa4d6b09fe40e636c7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #2671 +/- ##
==========================================
+ Coverage 81.25% 81.26% +0.01%
==========================================
Files 42 42
Lines 33910 33920 +10
Branches 33910 33920 +10
==========================================
+ Hits 27553 27566 +13
+ Misses 2792 2790 -2
+ Partials 3565 3564 -1
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/pull/2671?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] MsSql: Keep the comma separator when displaying DECLARE lists [datafusion-sqlparser-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #2671:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2671#discussion_r4328984438
##########
tests/sqlparser_mssql.rs:
##########
@@ -3004,3 +3006,10 @@ fn parse_create_proc() {
.expect_err("PROC should remain MSSQL-specific");
ms_and_generic().verified_stmt("SELECT proc FROM jobs");
}
+
+#[test]
+fn parse_mssql_declare_comma_list_display() {
Review Comment:
I don't see any tests for `;` as a separator 🤔
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org