Skip to content

ImportInto: add import sdk for cloud | tidb-test=b256656b231ebd8f752e8738e89fc64f5263721a #61016

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

Merged
merged 10 commits into from
May 23, 2025

Conversation

GMHDBJD
Copy link
Contributor

@GMHDBJD GMHDBJD commented May 8, 2025

What problem does this PR solve?

Issue Number: ref #61264

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 8, 2025
Copy link

tiprow bot commented May 8, 2025

Hi @GMHDBJD. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 19, 2025
@GMHDBJD GMHDBJD changed the title ImportInto: add create schemas sdk for cloud ImportInto: add import sdk for cloud May 19, 2025
@GMHDBJD GMHDBJD changed the base branch from master to CloudImportNextGen May 19, 2025 15:01
@GMHDBJD GMHDBJD changed the title ImportInto: add import sdk for cloud ImportInto: add import sdk for cloud | tidb-test=master May 19, 2025
@GMHDBJD GMHDBJD changed the base branch from CloudImportNextGen to feature/next-gen-importer May 20, 2025 13:07
Copy link

codecov bot commented May 20, 2025

Codecov Report

Attention: Patch coverage is 86.72566% with 45 lines in your changes missing coverage. Please review.

Project coverage is 73.5527%. Comparing base (d08abd5) to head (ad55b47).
Report is 8 commits behind head on feature/next-gen-importer.

Additional details and impacted files
@@                        Coverage Diff                        @@
##           feature/next-gen-importer     #61016        +/-   ##
=================================================================
+ Coverage                    73.1819%   73.5527%   +0.3708%     
=================================================================
  Files                           1724       1727         +3     
  Lines                         477752     484073      +6321     
=================================================================
+ Hits                          349628     356049      +6421     
+ Misses                        106707     106471       -236     
- Partials                       21417      21553       +136     
Flag Coverage Δ
integration 42.4891% <0.0000%> (?)
unit 72.3794% <86.7256%> (+0.0040%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 46.0863% <ø> (-1.6467%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@joechenrh joechenrh left a comment

Choose a reason for hiding this comment

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

These comments don't need to be resolved for now, we can change it in PR for master.

}

// GetTablesMeta implements the CloudImportSDK interface
func (sdk *ImportSDK) GetTablesMeta(ctx context.Context) ([]*TableMeta, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we can store allDataFiles in ImportSDK and initialize it in NewImportSDK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually I think cloud only need GetTablesMeta, no need to call GetableMetaByName, so the allDataFiles will only calculate once

}

// Process data files
dataFiles, totalSize, err := sdk.processDataFiles(tblMeta.DataFiles)
Copy link
Contributor

Choose a reason for hiding this comment

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

Make processDataFiles return TableMeta directly?

Comment on lines +54 to +58
mock.ExpectQuery(`SELECT SCHEMA_NAME FROM information_schema.SCHEMATA`).
WillReturnRows(sqlmock.NewRows([]string{"SCHEMA_NAME"}).AddRow("cloud_csv"))
mock.ExpectQuery("SHOW CREATE TABLE `cloud_csv`.`t`").
WillReturnRows(sqlmock.NewRows([]string{"Create Table"}).AddRow(`create table t (a bigint primary key, b varchar(100), c varchar(100), d int,
key(a), key(c,d), key(d));`))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verify table exist if there is no table schema in source files

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 21, 2025
@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented May 21, 2025

/retest

Copy link

tiprow bot commented May 21, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented May 22, 2025

/retest

Copy link

tiprow bot commented May 22, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented May 22, 2025

/retest

Copy link

tiprow bot commented May 22, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@GMHDBJD GMHDBJD changed the title ImportInto: add import sdk for cloud | tidb-test=master ImportInto: add import sdk for cloud | tidb-test=b256656b231ebd8f752e8738e89fc64f5263721a May 22, 2025
@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented May 22, 2025

/retest

Copy link

tiprow bot commented May 22, 2025

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 23, 2025
Copy link

ti-chi-bot bot commented May 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, joechenrh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented May 23, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-21 07:54:25.682185265 +0000 UTC m=+161902.783352487: ☑️ agreed by joechenrh.
  • 2025-05-23 05:53:07.995927556 +0000 UTC m=+12213.941192366: ☑️ agreed by Benjamin2037.

@ti-chi-bot ti-chi-bot bot added the approved label May 23, 2025
@ti-chi-bot ti-chi-bot bot merged commit 66debdc into pingcap:feature/next-gen-importer May 23, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants