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

[feature] support specify the number of hash partition tables #587

Closed
zhyass opened this issue Mar 6, 2020 · 0 comments
Closed

[feature] support specify the number of hash partition tables #587

zhyass opened this issue Mar 6, 2020 · 0 comments
Assignees
Milestone

Comments

@zhyass
Copy link
Contributor

zhyass commented Mar 6, 2020

In MySQL, we can specify the number of partition tables. such as:

CREATE TABLE employees (
    id INT NOT NULL,
    fname VARCHAR(30),
    lname VARCHAR(30),
    hired DATE NOT NULL DEFAULT '1970-01-01',
    separated DATE NOT NULL DEFAULT '9999-12-31',
    job_code INT,
    store_id INT
)
PARTITION BY HASH(store_id)
PARTITIONS 4;

By PARTITIONS 4 can create a hash table with 4 partitions.

Radon can refer to the practice of mysql, and specify the number of hash partition tables through partitions. The number of partitions is limited to [8,16,32,64].

@zhyass zhyass added this to the v1.0.8 milestone Mar 6, 2020
@zhyass zhyass self-assigned this Mar 6, 2020
@zhyass zhyass changed the title [feature] support specify the number of partition tables [feature] support specify the number of hash partition tables Mar 6, 2020
zhyass added a commit to zhyass/radon that referenced this issue Mar 6, 2020
[summary]
syntax:
 CREATE TABLE ... ...
 PARTITION BY HASH(shard-key)
 PARTITIONS num;

The `num` is a positive integer, limited to [8,16,32,64].
[test case]
src/proxy/ddl_test.go
src/router/compute_test.go
src/router/frm_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go
[patch codecov]
src/proxy/ddl.go 95.2%
src/router/compute.go 100%
src/router/frm.go 86.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 85.9%
zhyass added a commit to zhyass/radon that referenced this issue Mar 6, 2020
[summary]
syntax:
 CREATE TABLE ... ...
 PARTITION BY HASH(shard-key)
 PARTITIONS num;

The `num` is a positive integer, limited to [8,16,32,64].
[test case]
src/proxy/ddl_test.go
src/router/compute_test.go
src/router/frm_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go
[patch codecov]
src/proxy/ddl.go 95.2%
src/router/compute.go 100%
src/router/frm.go 86.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 85.9%
zhyass added a commit to zhyass/radon that referenced this issue Mar 6, 2020
[summary]
syntax:
 CREATE TABLE ... ...
 PARTITION BY HASH(shard-key)
 PARTITIONS num;

The `num` is a positive integer, limited to [8,16,32,64].
[test case]
src/proxy/ddl_test.go
src/router/compute_test.go
src/router/frm_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go
[patch codecov]
src/proxy/ddl.go 95.2%
src/router/compute.go 100%
src/router/frm.go 86.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 85.9%
@zhyass zhyass modified the milestones: v1.0.8, v1.0.9 Mar 7, 2020
@zhyass zhyass assigned hustjieke and unassigned hustjieke Mar 7, 2020
zhyass added a commit to zhyass/radon that referenced this issue Mar 19, 2020
[summary]
syntax:
 CREATE TABLE ... ...
 PARTITION BY HASH(shard-key)
 PARTITIONS num;

The `num` is a positive integer, limited to [8,16,32,64].
[test case]
src/proxy/ddl_test.go
src/router/compute_test.go
src/router/frm_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go
[patch codecov]
src/proxy/ddl.go 95.2%
src/router/compute.go 100%
src/router/frm.go 86.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 85.9%
@BohuTANG BohuTANG modified the milestones: v1.0.9, v1.1.0 Mar 29, 2020
BohuTANG pushed a commit that referenced this issue Mar 31, 2020
[summary]
syntax:
 CREATE TABLE ... ...
 PARTITION BY HASH(shard-key)
 PARTITIONS num;

The `num` is a positive integer, limited to [8,16,32,64].
[test case]
src/proxy/ddl_test.go
src/router/compute_test.go
src/router/frm_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go
[patch codecov]
src/proxy/ddl.go 95.2%
src/router/compute.go 100%
src/router/frm.go 86.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 85.9%
@BohuTANG BohuTANG closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants