Support colllation for planner refactory test framework#5449
Support colllation for planner refactory test framework#5449ti-chi-bot merged 10 commits intopingcap:masterfrom
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
@xzhangxian1008: GitHub didn't allow me to request PR reviews from the following users: /cc. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this: 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. |
| explicit DAGRequestBuilder(size_t & index, Int32 collator = TiDB::ITiDBCollator::UTF8MB4_BIN) | ||
| : executor_index(index) | ||
| { | ||
| properties.collator = -abs(collator); |
There was a problem hiding this comment.
Why do we use -abs(collator) instead of just collator?
There was a problem hiding this comment.
Why do we use
-abs(collator)instead of justcollator?
collator passed by tidb is negative, so we need to guarantee the collator < 0. See https://github.com/pingcap/tiflash/blob/master/dbms/src/Flash/Coprocessor/DAGUtils.cpp#L1357
dbms/src/TestUtils/mockExecutor.h
Outdated
| DAGRequestBuilder & sort(MockOrderByItem order_by, bool is_partial_sort, uint64_t fine_grained_shuffle_stream_count = 0); | ||
| DAGRequestBuilder & sort(MockOrderByItemVec order_by_vec, bool is_partial_sort, uint64_t fine_grained_shuffle_stream_count = 0); | ||
|
|
||
| void setCollation(Int32 collator_) { properties.collator = -abs(collator_); } |
There was a problem hiding this comment.
may be we can wrap a function for -abs(collator_)
/// add some comments
Int32 inline getXXXCollation(Int32 collator_)
{
return -abs(collator_);
}
There was a problem hiding this comment.
may be we can wrap a function for
-abs(collator_)/// add some comments Int32 inline getXXXCollation(Int32 collator_) { return -abs(collator_); }
ok
| { | ||
| context.setCollation(collation); | ||
| auto request = context.scan(db_name, table_name).aggregation(MockAstVec{}, {col(col_name)}).project({col_name}).build(context); | ||
| std::cout << request->DebugString() << std::endl; |
There was a problem hiding this comment.
useless code?
I will delete it
| context.setCollation(collation); | ||
| auto request = context.scan(db_name, table_name).aggregation(MockAstVec{}, {col(col_name)}).project({col_name}).build(context); | ||
| std::cout << request->DebugString() << std::endl; | ||
| ASSERT_COLUMNS_EQ_UR(expect, executeStreams(request, 1)); |
There was a problem hiding this comment.
seems executeStreams(reuqest) is enough.
There was a problem hiding this comment.
seems
executeStreams(reuqest)is enough.
ok
| std::queue<tipb::Executor *> executors; | ||
| tipb::Executor * executor = dag_request->mutable_root_executor(); | ||
| executors.push(executor); |
There was a problem hiding this comment.
There was a problem hiding this comment.
We can use https://github.com/pingcap/tiflash/blob/e289119502cb4f2643eb1810dffb4434a611b0a9/dbms/src/Flash/Statistics/traverseExecutors.h to visit DAGRequest
Done
| { | ||
| std::queue<tipb::Executor *> executors; | ||
| std::queue<const tipb::Expr *> exprs; | ||
| tipb::Executor * executor = dag_request->mutable_root_executor(); |
| { | ||
| public: | ||
| explicit MockDAGRequestContext(Context context_) | ||
| explicit MockDAGRequestContext(Context context_, Int32 collation_ = TiDB::ITiDBCollator::UTF8MB4_BIN) |
There was a problem hiding this comment.
Why is the default parameter not no collation?
There was a problem hiding this comment.
Why is the default parameter not
no collation?
Because tidb opens the collation by default recently, and sets it as UTF8MB4_BIN.
|
/merge |
|
@ywqzzy: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. DetailsInstructions 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 ti-community-infra/tichi repository. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 9880766 |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: close #5432
Problem Summary:
Support colllation for planner refactory test framework
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note