You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "princejain756 (via GitHub)" <gi...@apache.org> on 2026/10/21 20:23:24 UTC

[PR] MsSql: Preserve ALTER ROLE ... WITH NAME = on display [datafusion-sqlparser-rs]

princejain756 opened a new pull request, #2709:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2709

   `ALTER ROLE old_name WITH NAME = new_name`, the only rename form T-SQL accepts [1], parses into `AlterRoleOperation::RenameRole`, which `Display` renders as `RENAME TO` - syntax T-SQL cannot parse back:
   
   ```rust
   Parser::parse_sql(&MsSqlDialect {}, "ALTER ROLE a WITH NAME = b")
       .unwrap()[0].to_string()
   // "ALTER ROLE a RENAME TO b"  <- fails on reparse under MsSqlDialect
   ```
   
   `RenameRole` now carries a `use_with_name` flag set by the mssql parse path, so the statement renders back as `WITH NAME =`. The `RENAME TO` parse path (Postgres/Generic) is unchanged.
   
   Verified against the T-SQL grammar [1]: `ALTER ROLE` offers only `ADD MEMBER`, `DROP MEMBER`, and `WITH NAME =`; `RENAME TO` does not exist there.
   
   [1] https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-role-transact-sql
   
   Written with AI assistance (SWE-2 Max via Devin).
   


-- 
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: Preserve ALTER ROLE ... WITH NAME = on display [datafusion-sqlparser-rs]

Posted by "alamb (via GitHub) via github" <gi...@datafusion.apache.org>.
alamb closed pull request #2709: MsSql: Preserve ALTER ROLE ... WITH NAME = on display
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2709


-- 
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: Preserve ALTER ROLE ... WITH NAME = on display [datafusion-sqlparser-rs]

Posted by "alamb (via GitHub) via github" <gi...@datafusion.apache.org>.
alamb commented on PR #2709:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2709#issuecomment-6558069278

   Thank you for the contribution. The change may well be correct, but I am closing this PR under the DataFusion AI policy, which also applies to sqlparser-rs: https://datafusion.apache.org/contributor-guide/ai-policy.html#what-is-an-ai-dump-and-why-it-is-not-helpful
   
   Maintainer review time is the scarcest resource in this project. This account has recently opened many AI-generated PRs across many repositories. Similar PRs from this account have also been closed in other Apache DataFusion and Arrow repositories (apache/datafusion and apache/arrow-rs). That suggests the changes aren't coming from someone who uses sqlparser-rs, and that no human will be around to discuss review feedback and maintain the code. Reviewing PRs like this costs us more time than it saves.
   
   If you do use sqlparser-rs and this fix matters to you, please pick the one change you care most about. Then open a focused PR with a short description in your own words, one you have reviewed and understand, and we'd be happy to help with review.
   


-- 
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