Skip to content
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

importinto: import from select parser/planner part #49976

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Jan 2, 2024

What problem does this PR solve?

Issue Number: ref #49883

Problem Summary:

What changed and how does it work?

  • parser/planner part of import from select

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 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. labels Jan 2, 2024
Copy link

tiprow bot commented Jan 2, 2024

Hi @D3Hunter. 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/test-infra repository.

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Merging #49976 (33c4ac5) into master (b4ba24b) will decrease coverage by 11.5438%.
Report is 32 commits behind head on master.
The diff coverage is 81.2807%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #49976         +/-   ##
=================================================
- Coverage   79.3242%   67.7804%   -11.5438%     
=================================================
  Files          2445       2566        +121     
  Lines        673508     852411     +178903     
=================================================
+ Hits         534255     577768      +43513     
- Misses       117867     250640     +132773     
- Partials      21386      24003       +2617     
Flag Coverage Δ
integration 37.7540% <53.3834%> (?)
unit 79.6775% <75.8620%> (+0.3532%) ⬆️

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

Components Coverage Δ
dumpling 73.6130% <ø> (ø)
parser ∅ <ø> (∅)
br 72.2233% <ø> (+3.7290%) ⬆️

@D3Hunter D3Hunter mentioned this pull request Jan 2, 2024
7 tasks
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 2, 2024

/retest

Copy link

tiprow bot commented Jan 2, 2024

@D3Hunter: 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/test-infra repository.

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 2, 2024

/retest

Copy link

tiprow bot commented Jan 2, 2024

@D3Hunter: 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/test-infra repository.

@@ -58,6 +58,7 @@ const unknownImportedRowCount = -1
// ImportIntoExec represents a IMPORT INTO executor.
Copy link
Contributor

Choose a reason for hiding this comment

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

Import into and import from select

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they're both IMPORT INTO statement

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

pkg/parser reviewed

return nil, ErrWrongValueCountOnRow.GenWithStackByArgs(1)
}
for _, cu := range ld.ColumnsAndUserVars {
// all fields must be column
Copy link
Contributor

Choose a reason for hiding this comment

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

Does IMPORT INTO without SELECT support user variables? If not we can find the error when parsing SQL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use ColumnNameList (need to add brackets) instead of ColumnNameOrUserVarListOptWithBrackets

p.SelectPlan, _, err2 = DoOptimize(ctx, b.ctx, b.optFlag, selectPlan.(LogicalPlan))
if err2 != nil {
return nil, err2
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also want to return some friendly information to user? We can p.setSchemaAndNames

Copy link
Contributor Author

Choose a reason for hiding this comment

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

import from select works like insert into, not a background job, it will have a Message: rowsAffected like load data

but we can change it later after formal discuss

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 5, 2024
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 5, 2024

/retest

Copy link

tiprow bot commented Jan 5, 2024

@D3Hunter: 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/test-infra repository.

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 5, 2024
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 5, 2024

/retest

Copy link

tiprow bot commented Jan 5, 2024

@D3Hunter: 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/test-infra repository.

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 5, 2024

/retest

Copy link

tiprow bot commented Jan 5, 2024

@D3Hunter: 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/test-infra repository.

@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 6, 2024
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 8, 2024

/retest

Copy link

tiprow bot commented Jan 8, 2024

@D3Hunter: 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/test-infra repository.

@D3Hunter D3Hunter requested a review from GMHDBJD January 8, 2024 02:26
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 8, 2024
Copy link

ti-chi-bot bot commented Jan 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-05 03:58:37.377904911 +0000 UTC m=+2402208.415131838: ☑️ agreed by lance6716.
  • 2024-01-08 03:06:43.595889136 +0000 UTC m=+239793.180142823: ☑️ agreed by ywqzzy.

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 8, 2024

/retest

Copy link

tiprow bot commented Jan 8, 2024

@D3Hunter: 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/test-infra repository.

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 8, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jan 8, 2024
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 8, 2024

/hold

wait 7.6 code freeze

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 8, 2024
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 9, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2024
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 9, 2024

/approve

Copy link

@yudongusa yudongusa left a comment

Choose a reason for hiding this comment

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

LGTM for the parser of new syntax

Copy link

ti-chi-bot bot commented Jan 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, D3Hunter, lance6716, tangenta, yudongusa, ywqzzy

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

@ti-chi-bot ti-chi-bot bot added the approved label Jan 9, 2024
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 9, 2024

/retest

1 similar comment
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Jan 9, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit edecaa6 into pingcap:master Jan 9, 2024
22 checks passed
@D3Hunter D3Hunter deleted the import-from-select-parser branch January 9, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. 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.

6 participants