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

[refactoring] refactoring code #480

Closed
zhyass opened this issue Sep 9, 2019 · 5 comments
Closed

[refactoring] refactoring code #480

zhyass opened this issue Sep 9, 2019 · 5 comments
Assignees
Labels
type: refactoring Internal code refactoring wontfix

Comments

@zhyass
Copy link
Contributor

zhyass commented Sep 9, 2019

planner code has poor readability currently, we need refactoring the code.

@zhyass zhyass added the type: refactoring Internal code refactoring label Sep 9, 2019
@zhyass zhyass self-assigned this Sep 9, 2019
@zhyass zhyass changed the title [refactoring] refactoring planner code [refactoring] refactoring code Sep 10, 2019
zhyass added a commit to zhyass/radon that referenced this issue Sep 10, 2019
zhyass added a commit to zhyass/radon that referenced this issue Sep 10, 2019
[summary]
`executor` code has poor readability currently, we need refactoring the code.
[test case]
src/executor/executor_test.go
src/executor/select_executor_test.go
src/executor/union_executor_test.go
src/executor/engine/join_engine_test.go
src/executor/engine/merge_engine_test.go
src/executor/engine/union_engine_test.go
src/executor/engine/operator/aggregate_operator_test.go
src/executor/engine/operator/limit_operator_test.go
src/executor/engine/operator/orderby_operator_test.go
[patch codecov]
src/executor/select_executor.go 100%
src/executor/union_executor.go 100%
src/executor/engine/common.go 81.8%
src/executor/engine/join_engine.go 92.1%
src/executor/engine/merge_engine.go 92.5%
src/executor/engine/merge_join.go 97.2%
src/executor/engine/plan_engine.go 100%
src/executor/engine/union_engine.go 85.7%
src/executor/engine/operator/aggregate_operator.go 98.1%
src/executor/engine/operator/limit_operator.go 100%
src/executor/engine/operator/operator.go 78.6%
src/executor/engine/operator/orderby_operator.go 83.3%
zhyass added a commit to zhyass/radon that referenced this issue Sep 10, 2019
[summary]
`executor` code has poor readability currently, we need refactoring the code.
[test case]
src/executor/executor_test.go
src/executor/select_executor_test.go
src/executor/union_executor_test.go
src/executor/engine/join_engine_test.go
src/executor/engine/merge_engine_test.go
src/executor/engine/union_engine_test.go
src/executor/engine/operator/aggregate_operator_test.go
src/executor/engine/operator/limit_operator_test.go
src/executor/engine/operator/orderby_operator_test.go
[patch codecov]
src/executor/select_executor.go 100%
src/executor/union_executor.go 100%
src/executor/engine/common.go 81.8%
src/executor/engine/join_engine.go 92.1%
src/executor/engine/merge_engine.go 92.5%
src/executor/engine/merge_join.go 97.2%
src/executor/engine/plan_engine.go 100%
src/executor/engine/union_engine.go 85.7%
src/executor/engine/operator/aggregate_operator.go 98.1%
src/executor/engine/operator/limit_operator.go 100%
src/executor/engine/operator/operator.go 78.6%
src/executor/engine/operator/orderby_operator.go 83.3%
zhyass added a commit to zhyass/radon that referenced this issue Sep 10, 2019
[summary]
`executor` code has poor readability currently, we need refactoring the code.
[test case]
src/executor/executor_test.go
src/executor/select_executor_test.go
src/executor/union_executor_test.go
src/executor/engine/join_engine_test.go
src/executor/engine/merge_engine_test.go
src/executor/engine/union_engine_test.go
src/executor/engine/operator/aggregate_operator_test.go
src/executor/engine/operator/limit_operator_test.go
src/executor/engine/operator/orderby_operator_test.go
[patch codecov]
src/executor/select_executor.go 100%
src/executor/union_executor.go 100%
src/executor/engine/common.go 81.8%
src/executor/engine/join_engine.go 96.0%
src/executor/engine/merge_engine.go 97.5%
src/executor/engine/merge_join.go 98.6%
src/executor/engine/plan_engine.go 100%
src/executor/engine/union_engine.go 95.2%
src/executor/engine/operator/aggregate_operator.go 98.1%
src/executor/engine/operator/limit_operator.go 100%
src/executor/engine/operator/operator.go 85.7%
src/executor/engine/operator/orderby_operator.go 95.8%
BohuTANG pushed a commit that referenced this issue Sep 19, 2019
[summary]
`executor` code has poor readability currently, we need refactoring the code.
[test case]
src/executor/executor_test.go
src/executor/select_executor_test.go
src/executor/union_executor_test.go
src/executor/engine/join_engine_test.go
src/executor/engine/merge_engine_test.go
src/executor/engine/union_engine_test.go
src/executor/engine/operator/aggregate_operator_test.go
src/executor/engine/operator/limit_operator_test.go
src/executor/engine/operator/orderby_operator_test.go
[patch codecov]
src/executor/select_executor.go 100%
src/executor/union_executor.go 100%
src/executor/engine/common.go 81.8%
src/executor/engine/join_engine.go 96.0%
src/executor/engine/merge_engine.go 97.5%
src/executor/engine/merge_join.go 98.6%
src/executor/engine/plan_engine.go 100%
src/executor/engine/union_engine.go 95.2%
src/executor/engine/operator/aggregate_operator.go 98.1%
src/executor/engine/operator/limit_operator.go 100%
src/executor/engine/operator/operator.go 85.7%
src/executor/engine/operator/orderby_operator.go 95.8%
zhyass added a commit to zhyass/radon that referenced this issue Oct 29, 2019
[summary]
rename some objects.
zhyass added a commit to zhyass/radon that referenced this issue Oct 30, 2019
[summary]
Using CastToBool instead of judging value directly will make the result more accurate.
[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/depends/sqltypes/arithmetic_test.go
[patch codecov]
96.9%
zhyass added a commit to zhyass/radon that referenced this issue Oct 30, 2019
[summary]
Using CastToBool instead of judging value directly will make the result more accurate.
[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/depends/sqltypes/arithmetic_test.go
[patch codecov]
94.2%
zhyass added a commit to zhyass/radon that referenced this issue Oct 30, 2019
[summary]
Using CastToBool instead of judging value directly will make the result more accurate.
[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/depends/sqltypes/arithmetic_test.go
[patch codecov]
94.2%
zhyass added a commit to zhyass/radon that referenced this issue Oct 30, 2019
[summary]
Using CastToBool instead of judging value directly will make the result more accurate.
[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/depends/sqltypes/arithmetic_test.go
[patch codecov]
94.2%
BohuTANG pushed a commit that referenced this issue Oct 31, 2019
[summary]
Using CastToBool instead of judging value directly will make the result more accurate.
[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/depends/sqltypes/arithmetic_test.go
[patch codecov]
94.2%
zhyass added a commit to zhyass/radon that referenced this issue Oct 31, 2019
[summary]
rename some objects.
zhyass added a commit to zhyass/radon that referenced this issue Oct 31, 2019
[summary]
merge the filterTuple and joinTuple.
[test case]
src/planner/from_test.go
src/planner/select_plan_test.go
[patch codecov]
96.9%
BohuTANG pushed a commit that referenced this issue Oct 31, 2019
[summary]
rename some objects.
BohuTANG pushed a commit that referenced this issue Oct 31, 2019
[summary]
merge the filterTuple and joinTuple.
[test case]
src/planner/from_test.go
src/planner/select_plan_test.go
[patch codecov]
96.9%
zhyass added a commit to zhyass/radon that referenced this issue Nov 1, 2019
[summary]
`planner` code has poor readability currently, we need refactoring the code.
[test case]
src/planner/builder/aggregate_plan_test.go
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/builder/from_test.go
src/planner/builder/limit_plan_test.go
src/planner/builder/orderby_plan_test.go
src/planner/builder/sqlparser_test.go
src/planner/others_plan_test.go
src/planner/planner_test.go
src/planner/select_plan_test.go
src/planner/union_plan_test.go
[patch codecov]
src/planner/builder 97.7%
src/planner 95.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 1, 2019
[summary]
`planner` code has poor readability currently, we need refactoring the code.
[test case]
src/planner/builder/aggregate_plan_test.go
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/builder/from_test.go
src/planner/builder/limit_plan_test.go
src/planner/builder/orderby_plan_test.go
src/planner/builder/sqlparser_test.go
src/planner/others_plan_test.go
src/planner/planner_test.go
src/planner/select_plan_test.go
src/planner/union_plan_test.go
[patch codecov]
src/planner/builder 97.7%
src/planner 95.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 2, 2019
[summary]
`planner` code has poor readability currently, we need refactoring the code.
[test case]
src/planner/builder/aggregate_plan_test.go
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/builder/from_test.go
src/planner/builder/limit_plan_test.go
src/planner/builder/orderby_plan_test.go
src/planner/builder/sqlparser_test.go
src/planner/others_plan_test.go
src/planner/planner_test.go
src/planner/select_plan_test.go
src/planner/union_plan_test.go
[patch codecov]
src/planner/builder 97.7%
src/planner 95.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 2, 2019
[summary]
`planner` code has poor readability currently, we need refactoring the code.
[test case]
src/planner/builder/aggregate_plan_test.go
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/builder/from_test.go
src/planner/builder/limit_plan_test.go
src/planner/builder/orderby_plan_test.go
src/planner/builder/sqlparser_test.go
src/planner/others_plan_test.go
src/planner/planner_test.go
src/planner/select_plan_test.go
src/planner/union_plan_test.go
[patch codecov]
src/planner/builder 97.7%
src/planner 95.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 2, 2019
[summary]
`planner` code has poor readability currently, we need refactoring the code.
[test case]
src/planner/builder/aggregate_plan_test.go
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/builder/from_test.go
src/planner/builder/limit_plan_test.go
src/planner/builder/orderby_plan_test.go
src/planner/builder/sqlparser_test.go
src/planner/others_plan_test.go
src/planner/planner_test.go
src/planner/select_plan_test.go
src/planner/union_plan_test.go
[patch codecov]
src/planner/builder 97.7%
src/planner 95.8%
BohuTANG pushed a commit that referenced this issue Nov 2, 2019
[summary]
`planner` code has poor readability currently, we need refactoring the code.
[test case]
src/planner/builder/aggregate_plan_test.go
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/builder/from_test.go
src/planner/builder/limit_plan_test.go
src/planner/builder/orderby_plan_test.go
src/planner/builder/sqlparser_test.go
src/planner/others_plan_test.go
src/planner/planner_test.go
src/planner/select_plan_test.go
src/planner/union_plan_test.go
[patch codecov]
src/planner/builder 97.7%
src/planner 95.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 4, 2019
[summary]
src/executor/engine/join_engine_test.go
src/planner/builder/builder_test.go
src/planner/builder/from_test.go
src/planner/select_plan_test.go
[patch codecov]
src/planner/builder 97.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 4, 2019
[summary]
Refactor the joinnode code about tableFilter by using CloneExpr.
[test case]
src/executor/engine/join_engine_test.go
src/planner/builder/builder_test.go
src/planner/builder/from_test.go
src/planner/select_plan_test.go
[patch codecov]
src/planner/builder 97.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 4, 2019
[summary]
Colname in having must be included in fields, meed check it in parseHaving.
[test case]
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/select_plan_test.go
[patch codecov]
src/planner/builder 97.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 5, 2019
[summary]
Refactor the joinnode code about tableFilter by using CloneExpr.
[test case]
src/executor/engine/join_engine_test.go
src/planner/builder/builder_test.go
src/planner/builder/from_test.go
src/planner/select_plan_test.go
[patch codecov]
src/planner/builder 97.8%
zhyass added a commit to zhyass/radon that referenced this issue Nov 5, 2019
[summary]
Colname in having must be included in fields, meed check it in parseHaving.
[test case]
src/planner/builder/builder_test.go
src/planner/builder/expr_test.go
src/planner/select_plan_test.go
[patch codecov]
src/planner/builder 97.8%
zhyass pushed a commit to zhyass/radon that referenced this issue May 27, 2020
[summary]
In vitess, the AST visitor has been restructured, these work are worthy of reference.
The AST structs and interface implementations live in the ast.go, which is what the visitor generator reads to produce the visitor.
The rest of the AST functionality, all methods belonging to structs and not implementing any interfaces, now live in ast_funcs.go.

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast. 87.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go 95.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parser.go 90.9%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.0%
@zhyass
Copy link
Contributor Author

zhyass commented May 27, 2020

In vitess, the AST visitor has been restructured, these work are worthy of reference.
vitessio/vitess#5611

zhyass pushed a commit to zhyass/radon that referenced this issue May 28, 2020
[summary]
In vitess, the AST visitor has been restructured, these work are worthy of reference.
The AST structs and interface implementations live in the ast.go, which is what the visitor generator reads to produce the visitor.
The rest of the AST functionality, all methods belonging to structs and not implementing any interfaces, now live in ast_funcs.go.

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 87.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go 95.8%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parser.go 90.9%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.0%
zhyass pushed a commit to zhyass/radon that referenced this issue May 28, 2020
[summary]
Package visitorgen is responsible for taking the ast.go of Radon and producing visitor infrastructure for it.

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/ast_walker_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/struct_producer_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/transformer_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/visitor_emitter_test.go

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/ast_walker.go 80.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/sast.go 87.5%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/struct_producer.go 94.6%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/transformer.go 97.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/visitor_emitter.go 31.8%
zhyass pushed a commit to zhyass/radon that referenced this issue May 28, 2020
[summary]
Rewrite traverses a syntax tree recursively, starting with root, and calling pre and post for each node as described below. Rewrite returns the syntax tree, possibly modified.
[test case]
N/A
[patch codecov]
N/A
zhyass pushed a commit to zhyass/radon that referenced this issue May 28, 2020
[summary]
Remove old visitor and replace functionality, use rewriter as the new visitor.

[test case]
N/A

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go 64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter_api.go 84.6%
zhyass pushed a commit to zhyass/radon that referenced this issue May 28, 2020
…adondb#480

[summary]
Remove old visitor and replace functionality, use rewriter as the new visitor.

[test case]
N/A

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go 64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter_api.go 84.6%
zhyass pushed a commit to zhyass/radon that referenced this issue May 28, 2020
…adondb#480

[summary]
Remove old visitor and replace functionality, use rewriter as the new visitor.

[test case]
N/A

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_funcs.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go 64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter_api.go 84.6%
BohuTANG added a commit that referenced this issue Jun 1, 2020
sqlparser: restructure the ast #480
@zhyass
Copy link
Contributor Author

zhyass commented Jun 1, 2020

https://github.com/radondb/radon/blob/master/src/backend/txn.go#L445
https://github.com/golang/sync/tree/master/errgroup

	var mu sync.Mutex
	var wg sync.WaitGroup
        ... ...
	allErrors := make([]error, 0, 8)
        ... ...
		if x != nil {
			mu.Lock()
			allErrors = append(allErrors, x)
			mu.Unlock()
		}

We can use errorgroup.Group instead of WaitGroup.

zhyass pushed a commit to zhyass/radon that referenced this issue Jun 1, 2020
[summary]
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
We can use the errgroup to handle error under concurrency.

[test case]
N/A

[patch codecov]
N/A
zhyass pushed a commit to zhyass/radon that referenced this issue Jun 1, 2020
[summary]
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
We can use the errgroup to handle error under concurrency.

[test case]
N/A

[patch codecov]
src/backend/txn.go 89.8%
src/backend/xa.go 91.1%
src/executor/engine/join_engine.go 95.7%
src/executor/engine/union_engine.go 93.9%
zhyass pushed a commit to zhyass/radon that referenced this issue Jun 1, 2020
[summary]
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
We can use the errgroup to handle error under concurrency.
[test case]
N/A
[patch codecov]
src/backend/txn.go 89.8%
src/backend/xa.go 91.1%
src/executor/engine/join_engine.go 95.7%
src/executor/engine/union_engine.go 93.9%
zhyass added a commit to zhyass/radon that referenced this issue Jun 1, 2020
[summary]
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
We can use the errgroup to handle error under concurrency.
[test case]
N/A
[patch codecov]
src/backend/txn.go 89.8%
src/backend/xa.go 91.1%
src/executor/engine/join_engine.go 95.7%
src/executor/engine/union_engine.go 93.9%
zhyass added a commit that referenced this issue Jun 1, 2020
[summary]
In vitess, the AST visitor has been restructured, these work are worthy of reference.
The AST structs and interface implementations live in the ast.go, which is what the visitor generator reads to produce the visitor.
The rest of the AST functionality, all methods belonging to structs and not implementing any interfaces, now live in ast_funcs.go.

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 87.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go 95.8%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parser.go 90.9%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.0%
zhyass added a commit that referenced this issue Jun 1, 2020
[summary]
Package visitorgen is responsible for taking the ast.go of Radon and producing visitor infrastructure for it.

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/ast_walker_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/struct_producer_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/transformer_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/visitor_emitter_test.go

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/ast_walker.go 80.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/sast.go 87.5%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/struct_producer.go 94.6%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/transformer.go 97.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/visitorgen/visitor_emitter.go 31.8%
zhyass added a commit that referenced this issue Jun 1, 2020
[summary]
Rewrite traverses a syntax tree recursively, starting with root, and calling pre and post for each node as described below. Rewrite returns the syntax tree, possibly modified.
[test case]
N/A
[patch codecov]
N/A
zhyass added a commit that referenced this issue Jun 1, 2020
…480

[summary]
Remove old visitor and replace functionality, use rewriter as the new visitor.

[test case]
N/A

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_funcs.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go 64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter_api.go 84.6%
zhyass added a commit to zhyass/radon that referenced this issue Jun 2, 2020
[summary]
Package errgroup provides synchronization, error propagation, and Context cancelation for groups of goroutines working on subtasks of a common task.
We can use the errgroup to handle error under concurrency.
[test case]
N/A
[patch codecov]
src/backend/txn.go 89.8%
src/backend/xa.go 91.1%
src/executor/engine/join_engine.go 95.7%
src/executor/engine/union_engine.go 93.9%
BohuTANG added a commit that referenced this issue Jun 2, 2020
*: use errgroup to handle error under concurrency #480
zhyass added a commit to zhyass/radon that referenced this issue Jun 4, 2020
[summary]
partition_options:
    \* empty *\
  | GLOBAL
  | SINGLE
  | DISTRIBUTED BY (backend-name)
  | PARTITION BY HASH(shard-key) {PARTITIONS num}
  | PARTITION BY LIST(shard-key)(PARTITION backend VALUES IN (value_list),...)

[test case]
src/proxy/ddl_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go

[patch codecov]
src/proxy/ddl.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_funcs.go 95.5%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.3%
zhyass added a commit to zhyass/radon that referenced this issue Jun 5, 2020
[summary]
partition_options:
    \* empty *\
  | GLOBAL
  | SINGLE
  | DISTRIBUTED BY (backend-name)
  | PARTITION BY HASH(shard-key) {PARTITIONS num}
  | PARTITION BY LIST(shard-key)(PARTITION backend VALUES IN (value_list),...)

[test case]
src/proxy/ddl_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go

[patch codecov]
src/proxy/ddl.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_funcs.go 95.5%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.3%
zhyass added a commit to zhyass/radon that referenced this issue Jun 5, 2020
[summary]
reference: https://dev.mysql.com/doc/refman/5.7/en/create-table.html

CREATE TABLE [IF NOT EXISTS] tbl_name
    (create_definition,...)
    [table_options]
    [partition_options]

partition_options:
    \* empty *\
  | GLOBAL
  | SINGLE
  | DISTRIBUTED BY (backend-name)
  | PARTITION BY HASH(shard-key) {PARTITIONS num}
  | PARTITION BY LIST(shard-key)(PARTITION backend VALUES IN (value_list),...)

[test case]
src/proxy/ddl_test.go
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ddl_test.go

[patch codecov]
src/proxy/ddl.go 94.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_funcs.go 95.5%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.3%
BohuTANG added a commit that referenced this issue Jun 8, 2020
*: refactor partition definition #480
@stale
Copy link

stale bot commented Jul 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 31, 2020
@stale stale bot closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring Internal code refactoring wontfix
Projects
None yet
Development

No branches or pull requests

4 participants