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

*: move annotated attributes of AST node to resolve.Context #55634

Merged
merged 15 commits into from
Aug 29, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Aug 24, 2024

What problem does this PR solve?

Issue Number: ref #54436

Problem Summary:

What changed and how does it work?

move annotated attributes of AST node to a separate resolve.Context, to avoidparser pkg depends on semantic structs like TableInfo/DBInfo

This PR is one of the refactor PR to move model pkg out from parser to ddl:

  • We plan to replace the un-typed arguments Args []interface{} of Job to a series of structs depends on job type, and want to add them at DDL side as they are specific to DDL and better be maintained together, but we cannot do it now as it introduced dependency cycle. Structs like Job/BackfillMeta can be moved, but TableInfo cannot as AST depends on it. I hope we can move them all together.
  • Parser is a standalone go module for parsing SQL of MySQL dialect, generates AST and provides an interface to visit it. That's all that's needed if Parser is imported by other repos alone. And I guess that's one of the reasons that we make Parser independent of TiDB. TableInfo/Job/BackfillMeta and others are catalog and runtime structures specific to TiDB. They should stay in the TiDB realm.
    • AST structures are coupled with semantic catalog structures, such as ast.TableName depends on TableInfo.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

do a TPCC performance test, the first line 8.4.0-split is this PR, the second is nightly build
image
image
sysbench
image
image

  • 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

Copy link

ti-chi-bot bot commented Aug 24, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 24, 2024
@D3Hunter
Copy link
Contributor Author

/test all

Copy link

tiprow bot commented Aug 24, 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-sigs/prow repository.

Copy link

tiprow bot commented Aug 24, 2024

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

In response to this:

/test all

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

codecov bot commented Aug 24, 2024

Codecov Report

Attention: Patch coverage is 93.61702% with 21 lines in your changes missing coverage. Please review.

Project coverage is 74.7480%. Comparing base (fa533f8) to head (5f6e03a).
Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55634        +/-   ##
================================================
+ Coverage   72.7710%   74.7480%   +1.9770%     
================================================
  Files          1582       1586         +4     
  Lines        442822     442968       +146     
================================================
+ Hits         322246     331110      +8864     
+ Misses       100704      91581      -9123     
- Partials      19872      20277       +405     
Flag Coverage Δ
integration 48.9993% <83.5866%> (?)
unit 71.8878% <86.0182%> (+0.0015%) ⬆️

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

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 51.7630% <ø> (+6.3420%) ⬆️

@D3Hunter
Copy link
Contributor Author

/test all

Copy link

tiprow bot commented Aug 24, 2024

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

In response to this:

/test all

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.

@D3Hunter
Copy link
Contributor Author

/test all

Copy link

tiprow bot commented Aug 24, 2024

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

In response to this:

/test all

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.

@D3Hunter
Copy link
Contributor Author

/test all

Copy link

tiprow bot commented Aug 24, 2024

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

In response to this:

/test all

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.

@D3Hunter
Copy link
Contributor Author

/test all

Copy link

tiprow bot commented Aug 24, 2024

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

In response to this:

/test all

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 removed do-not-merge/invalid-title do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 26, 2024
@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 26, 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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 26, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 26, 2024
Copy link

ti-chi-bot bot commented Aug 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-26 09:04:34.845791128 +0000 UTC m=+774669.980241249: ☑️ agreed by hawkingrei.
  • 2024-08-26 12:32:26.346282664 +0000 UTC m=+787141.480732785: ☑️ agreed by lcwangchao.

@lcwangchao
Copy link
Collaborator

/test pull-lightning-integration-test

Copy link

tiprow bot commented Aug 28, 2024

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

In response to this:

/test pull-lightning-integration-test

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.

@D3Hunter
Copy link
Contributor Author

/approve

for parser pkg

@ti-chi-bot ti-chi-bot bot added the approved label Aug 29, 2024
Copy link

ti-chi-bot bot commented Aug 29, 2024

@D3Hunter: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-lightning-integration-test cfca5c2 link true /test pull-lightning-integration-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot removed the approved label Aug 29, 2024
This reverts commit 97aae37.
Copy link

ti-chi-bot bot commented Aug 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, hawkingrei, lance6716, lcwangchao, zanmato1984

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 Aug 29, 2024
@ti-chi-bot ti-chi-bot bot merged commit 4c23efb into pingcap:master Aug 29, 2024
21 checks passed
@D3Hunter D3Hunter deleted the split-parser-model branch August 29, 2024 13:59
@D3Hunter D3Hunter mentioned this pull request Sep 3, 2024
54 tasks
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. sig/planner SIG: Planner 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.

5 participants