You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "daguimu (via GitHub)" <gi...@apache.org> on 2026/04/29 16:17:33 UTC

[PR] Support parsing Doris RECOVER syntax for database, table, and partition [shardingsphere]

daguimu opened a new pull request, #38660:
URL: https://github.com/apache/shardingsphere/pull/38660

   ## Problem
   
   Doris ships a `RECOVER` administration statement that brings a dropped database, table, or partition back from the recycle bin, optionally with the original object id and/or a renamed target. None of the variants listed in #31503 are accepted by the current Doris parser:
   
   ```
   RECOVER DATABASE example_db
   RECOVER DATABASE example_db 10001
   RECOVER DATABASE example_db AS new_db
   RECOVER TABLE example_db.example_tbl
   RECOVER TABLE example_db.example_tbl 20002
   RECOVER TABLE example_db.example_tbl 20002 AS new_tbl
   RECOVER PARTITION p1 FROM example_tbl
   RECOVER PARTITION p1 FROM example_db.example_tbl
   RECOVER PARTITION p1 30003 FROM example_db.example_tbl
   ```
   
   ## Root Cause
   
   `DALStatement.g4` for the Doris dialect has no rule for `RECOVER` outside of XA transactions, so each form fails ANTLR parsing before any visitor runs.
   
   ## Fix
   
   - Add `recover`, `recoverDatabase`, `recoverTable`, and `recoverPartition` rules to the Doris `DALStatement.g4`, allowing the optional numeric id and the optional `AS new_name` tail for database/table forms, and `PARTITION name [id] FROM [db.]table` for the partition form.
   - Wire the new alternative into the top-level `execute` rule of `DorisStatement.g4`.
   - Introduce `DorisRecoverStatement` (object type, database/table segment, partition name, optional id, optional new name) and the matching `visitRecover` logic in `DorisDALStatementVisitor`.
   - Register the SPI entry in `SQLVisitorRule` and the assert/test-case glue (`DorisRecoverStatementAssert`, `DorisRecoverStatementTestCase`, `DorisDALStatementAssert`, `RootSQLParserTestCases`).
   
   ## Tests Added
   
   - `test/it/parser/src/main/resources/sql/supported/dal/recover.xml` covering the nine Doris syntaxes from #31503 plus a partition variant without the database-qualified table.
   - `test/it/parser/src/main/resources/case/dal/recover.xml` with the matching assertions.
   - `InternalDorisParserIT` runs cleanly: 1250 tests pass after the change.
   
   ## Fixes
   
   Refs #31503


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Doris RECOVER syntax for database, table, and partition [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #38660:
URL: https://github.com/apache/shardingsphere/pull/38660#issuecomment-4999221951

   Hi @daguimu, thanks again for your contribution.
   As mentioned in the June 18 follow-up, this PR has remained inactive, and the requested changes are still unaddressed on the current head. The branch now also conflicts with master, so I am closing this PR for now to keep the review queue clear.
   The underlying issue remains open. Please feel free to update the branch and ask us to reopen this PR, or submit a new PR with the missing RECOVER PARTITION ... AS <new_partition_name> support and matching parser IT coverage when you are ready to continue.
   Thanks again.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Doris RECOVER syntax for database, table, and partition [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed pull request #38660: Support parsing Doris RECOVER syntax for database, table, and partition
URL: https://github.com/apache/shardingsphere/pull/38660


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Doris RECOVER syntax for database, table, and partition [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #38660:
URL: https://github.com/apache/shardingsphere/pull/38660#issuecomment-4741439125

   Hi @daguimu, thanks again for working on this Doris parser improvement.
   
   This PR has had no response or update for a long time after the change request. The current implementation is in the right direction, but it is still not ready to merge because the documented Doris `RECOVER PARTITION ... AS <new_partition_name>` syntax is not supported yet, and the related parser test coverage is still incomplete.
   
   To keep the review queue clear, we will close this PR soon due to inactivity. You are very welcome to reopen it or submit a new PR later with the missing Doris RECOVER syntax support and matching parser IT assertions.
   
   Thanks again for your contribution.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org