-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Doris grammar rules for RECOVER and tests #33436
base: master
Are you sure you want to change the base?
Conversation
@@ -411,6 +411,18 @@ restart | |||
: RESTART | |||
; | |||
|
|||
recoverDatabase | |||
: RECOVER DATABASE databaseName (databaseId | AS newDatabaseName)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use rule-element-labels instead of the newDatabaseName rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
; | ||
|
||
recoverPartition | ||
: RECOVER PARTITION partitionName partitionId? (AS newPartitionName)? FROM tableName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@Setter | ||
public abstract class RecoverDatabaseStatement extends AbstractSQLStatement implements DDLStatement { | ||
|
||
private String databaseName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you consider using the DatabaseSegment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to DatabaseSegment
public abstract class RecoverPartitionStatement extends AbstractSQLStatement implements DDLStatement { | ||
|
||
private String partitionName; | ||
|
||
private String partitionId; | ||
|
||
private String databaseName; | ||
|
||
private String newPartitionName; | ||
|
||
private String owner; | ||
|
||
private String tableName; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, use class types instead of the primitive types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with the class types
import org.apache.shardingsphere.sql.parser.statement.doris.DorisStatement; | ||
|
||
/** | ||
* Doris create database statement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the code comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/** | ||
* Doris create database statement. | ||
*/ | ||
public final class DorisRecoverDatabaseStatement extends RecoverDatabaseStatement implements DorisStatement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to reuse this abstract class in other databases? If not, we should consider removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted the abstract class
https://shardingsphere.apache.org/community/en/involved/conduct/code/#maintenance-conduct Additionally, please update the release notes for 5.5.2-SNAPSHOT. |
Hi @shamilv, can you take a look for @iamhucong suggestion? |
Hi @strongduanmu |
ef8a0c1
to
60fdf5e
Compare
@iamhucong MySQL doesn't have a |
Hi @iamhucong / @strongduanmu |
Fixes #31504 .
Changes proposed in this pull request:
Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.