-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[BackupAndRestore] Support backup and restore view and external odbc table #5299
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rnal odbc table 1. Support backup and restore view and odbc table. The syntax is the same as that of the backup and restore table. 2. If the table associated with the view does not exist in the snapshot, the view can still be backed up successfully, but the TableNotFound exception will be thrown when querying the view. 3. If the odbc table associated with the odbc resource, the odbc resource will be backuped and restored together. 4. If the same view, odbc table and resource already exists in the database, it will compare whether the metadata of snapshot is consistent. If it is inconsistent, the restoration will fail. 4. This pr also modified the json format of the backup information. A `new_backup_objects` object is added to the root node to store backup meta-information other than olap table, such as views and external tables. ``` { "backup_objects": {}, "new_backup_objects": { "view": [ {"name": "view1", "id": "10001"} ], "odbc_table": [ {"name":"xxx", xxx} ] "odbc_resources": [ {"name": "bj_oracle"} ] } } ``` 5. This pr changes the serialization and deserialization method of backup information from manual construction to automatic analysis by Gson tools. Change-Id: I216469bf2a6484177185d8354dcca2dc19f653f3
EmmyMiao87
added
kind/feature
Categorizes issue or PR as related to a new feature.
area/backup
Issues of PRS related to backup and restore
labels
Jan 26, 2021
morningman
added
the
kind/meta-version-change
Categorizes issue or PR as related to changing meta version
label
Jan 26, 2021
morningman
reviewed
Jan 27, 2021
// read properties | ||
size = in.readInt(); | ||
for (int i = 0; i < size; i++) { | ||
properties.put(Text.readString(in), Text.readString(in)); |
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.
better deser key and value line by line.
morningman
approved these changes
Jan 27, 2021
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.
LGTM
EmmyMiao87
added a commit
to EmmyMiao87/incubator-doris
that referenced
this pull request
Apr 21, 2021
…table (apache#5299) [BackupAndRestore] Support backup and restore view and external odbc table 1. Support backup and restore view and odbc table. The syntax is the same as that of the backup and restore table. 2. If the table associated with the view does not exist in the snapshot, the view can still be backed up successfully, but the TableNotFound exception will be thrown when querying the view. 3. If the odbc table associated with the odbc resource, the odbc resource will be backuped and restored together. 4. If the same view, odbc table and resource already exists in the database, it will compare whether the metadata of snapshot is consistent. If it is inconsistent, the restoration will fail. 4. This pr also modified the json format of the backup information. A `new_backup_objects` object is added to the root node to store backup meta-information other than olap table, such as views and external tables. ``` { "backup_objects": {}, "new_backup_objects": { "view": [ {"name": "view1", "id": "10001"} ], "odbc_table": [ {"name":"xxx", xxx} ] "odbc_resources": [ {"name": "bj_oracle"} ] } } ``` 5. This pr changes the serialization and deserialization method of backup information from manual construction to automatic analysis by Gson tools. Change-Id: I216469bf2a6484177185d8354dcca2dc19f653f3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approved
Indicates a PR has been approved by one committer.
area/backup
Issues of PRS related to backup and restore
kind/feature
Categorizes issue or PR as related to a new feature.
kind/meta-version-change
Categorizes issue or PR as related to changing meta version
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
the view can still be backed up successfully, but the TableNotFound exception will be thrown when querying the view.
If it is inconsistent, the restoration will fail.
A
new_backup_objects
object is added to the root node to store backup meta-information other than olap table,such as views and external tables.
from manual construction to automatic analysis by Gson tools.
Change-Id: I216469bf2a6484177185d8354dcca2dc19f653f3
Types of changes
What types of changes does your code introduce to Doris?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.