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

add split table ... between ... and syntax #321

Merged
merged 8 commits into from
Jun 5, 2019

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented May 9, 2019

What problem does this PR solve?

Add new syntax for split index region.

SPLIT TABLE [table_name] INDEX [index_name] BETWEEN (lower_value) AND (upper_value) REGIONS [region_num]

Eg1: int type.

split table `t` index `idx1` between (0) and (1000) regions 5;

Upper sql will split 5 regions of the table t index idx1 in range 0~1000. Every region range like below:

Region1: -inf ~ 200

Region2: 200 ~ 400

Region3: 400 ~ 600

Region4: 600 ~ 800

Region5: 800 ~ +inf

What is changed and how it works?

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

Related changes

Copy link
Contributor

@winkyao winkyao 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

ast/dml.go Show resolved Hide resolved
parser.y Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 4, 2019

Codecov Report

Merging #321 into master will decrease coverage by 0.28%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #321      +/-   ##
==========================================
- Coverage   53.37%   53.09%   -0.29%     
==========================================
  Files          31       31              
  Lines        6540     6575      +35     
==========================================
  Hits         3491     3491              
- Misses       2707     2742      +35     
  Partials      342      342
Impacted Files Coverage Δ
parser.go 70.58% <ø> (ø) ⬆️
misc.go 96.42% <ø> (ø) ⬆️
ast/dml.go 40.82% <0%> (-1.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7fdc36c...b1f406a. Read the comment docs.

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133 bb7133 changed the title add split min max syntax add split table ... between ... and syntax Jun 5, 2019
ast/dml.go Outdated

type SplitOption struct {
Min []ExprNode
Max []ExprNode
Copy link
Member

Choose a reason for hiding this comment

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

I think lower and upper are more suitable to describe ranges

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133 bb7133 merged commit 82be48f into pingcap:master Jun 5, 2019
crazycs520 added a commit to crazycs520/parser that referenced this pull request Jun 19, 2019
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
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.

5 participants