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

feat: support parsing the RENAME TABLE statements in the parser #780

Merged
merged 7 commits into from
Dec 27, 2022

Conversation

e1ijah1
Copy link
Contributor

@e1ijah1 e1ijah1 commented Dec 22, 2022

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

support parsing the RENAME TABLE statements in the parser

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

#723

@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Merging #780 (0614d6e) into develop (e07791c) will increase coverage by 0.06%.
The diff coverage is 81.25%.

@@             Coverage Diff             @@
##           develop     #780      +/-   ##
===========================================
+ Coverage    85.42%   85.49%   +0.06%     
===========================================
  Files          414      414              
  Lines        54230    53904     -326     
===========================================
- Hits         46328    46085     -243     
+ Misses        7902     7819      -83     
Flag Coverage Δ
rust 85.49% <81.25%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
src/sql/src/statements/alter.rs 28.57% <0.00%> (-3.01%) ⬇️
src/sql/src/parsers/alter_parser.rs 90.47% <84.37%> (+2.63%) ⬆️
src/datanode/src/sql/alter.rs 92.39% <100.00%> (+1.14%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
tests-integration/src/test_util.rs 87.98% <0.00%> (-11.54%) ⬇️
src/datanode/src/instance.rs 32.40% <0.00%> (-11.18%) ⬇️
src/servers/src/mysql/handler.rs 59.84% <0.00%> (-4.55%) ⬇️
src/datatypes/src/vectors/constant.rs 83.20% <0.00%> (-3.06%) ⬇️
src/servers/src/grpc.rs 91.17% <0.00%> (-2.95%) ⬇️
src/table/src/metadata.rs 96.27% <0.00%> (-2.36%) ⬇️
... and 37 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@e1ijah1
Copy link
Contributor Author

e1ijah1 commented Dec 22, 2022

@evenyag PTAL

Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

Thanks @e1ijah1. Looks like there is no test covering the parser's change, do you mind adding some?

src/table/src/metadata.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

Let us leave the table and mito crates unchanged and add the AlterKind::RenameTable variant in the PR implementing rename table for the mito table engine. So this PR only affects the parser.

src/common/substrait/src/df_logical.rs Outdated Show resolved Hide resolved
src/sql/src/statements/alter.rs Show resolved Hide resolved
src/datanode/src/sql/alter.rs Outdated Show resolved Hide resolved
src/sql/src/parsers/alter_parser.rs Show resolved Hide resolved
src/datanode/src/sql/alter.rs Show resolved Hide resolved
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

I think it's fine to revert these changes.

src/table/src/requests.rs Outdated Show resolved Hide resolved
src/table/src/requests.rs Outdated Show resolved Hide resolved
src/table/src/requests.rs Outdated Show resolved Hide resolved
src/table/src/metadata.rs Outdated Show resolved Hide resolved
src/mito/src/table.rs Outdated Show resolved Hide resolved
@e1ijah1 e1ijah1 requested a review from evenyag December 23, 2022 06:15
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

Mostly LGTM. This should be the last suggestion 😄

src/sql/src/parsers/alter_parser.rs Outdated Show resolved Hide resolved
Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

Looks good to me ❤️

@e1ijah1 e1ijah1 requested a review from evenyag December 26, 2022 08:10
@evenyag evenyag merged commit 3978931 into GreptimeTeam:develop Dec 27, 2022
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
…timeTeam#780)

* feat: add parsing `alter rename table` syntax to the parser

* chore: fix clippy

* chore: add test for parser

* fix: add test for parsing RENAME keyword

* chore: remove unused code

* fix: parse table name object

Co-authored-by: Yingwen <[email protected]>

* chore: fmt code

Co-authored-by: Yingwen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants