Skip to content

feat(cli): implement import-v2 data import pipeline#7898

Open
fengjiachun wants to merge 3 commits intoGreptimeTeam:mainfrom
fengjiachun:feat/export-import-v2-pr3
Open

feat(cli): implement import-v2 data import pipeline#7898
fengjiachun wants to merge 3 commits intoGreptimeTeam:mainfrom
fengjiachun:feat/export-import-v2-pr3

Conversation

@fengjiachun
Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

As gemini said

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
@fengjiachun fengjiachun requested a review from a team as a code owner April 1, 2026 04:06
@github-actions github-actions bot added size/L docs-not-required This change does not impact docs. labels Apr 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements data import functionality for the import-v2 command, enabling the restoration of data from snapshots. It introduces the CopySource struct and execute_copy_database_from function to facilitate the COPY DATABASE SQL execution. The update also includes extensive end-to-end tests for data roundtrips, incomplete snapshots, and schema filtering. Feedback focuses on optimizing performance by replacing redundant storage listings with manifest checks, as well as improving code readability and formatting.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 646d7c1b4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
@fengjiachun
Copy link
Copy Markdown
Collaborator Author

@codex review

@fengjiachun fengjiachun requested review from WenyXu and discord9 April 1, 2026 21:05
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d72ed73f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +540 to +544
if chunk.status == ChunkStatus::Skipped {
continue;
}
for schema in schemas {
validate_chunk_schema_files(chunk, schema, &actual_prefixes)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject completed chunks with empty file manifests

validate_data_snapshot only checks each selected schema via validate_chunk_schema_files, and that helper returns Ok(false) whenever no matching prefix is found in chunk.files; as a result, a chunk marked Completed but carrying an empty files list is treated as “no data” and silently skipped, so import can report success while dropping that chunk’s data. Add an explicit invariant check that Completed chunks must contain at least one data file before continuing.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required This change does not impact docs. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant