-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
expression: reuse tipb.Expr 'val' to push down expression implicit parameters #10790
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10790 +/- ##
================================================
- Coverage 80.9963% 80.9551% -0.0412%
================================================
Files 419 419
Lines 88825 88759 -66
================================================
- Hits 71945 71855 -90
- Misses 11652 11672 +20
- Partials 5228 5232 +4 |
…rameters Signed-off-by: Lonng <[email protected]>
Signed-off-by: Lonng <[email protected]>
Signed-off-by: Lonng <[email protected]>
@breeswish PTAL |
LGTM |
/run-all-tests |
Signed-off-by: Lonng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please fix these CI problems. |
Signed-off-by: Lonng <[email protected]>
@@ -244,6 +253,17 @@ type baseBuiltinCastFunc struct { | |||
inUnion bool | |||
} | |||
|
|||
// implicitArgs returns the implicit arguments of cast functions | |||
func (b *baseBuiltinCastFunc) implicitArgs() []types.Datum { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use Datum
? Can we change to another data structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Datum
is the best structure which is used to exchange implicit arguments.
- Codec is easily on both sides.
- The encoded bytes are small.
- General used in TiDB/TiKV (some implicit arguments do not need any transform)
/run-all-tests |
/run-mybatis-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
Add an
implicitParameters
method to thebuiltinFunc
interface, and provide a default implementation forbaseBuiltinFunc
.The
UnionAll
executor will infer its children's results type and addCAST
function if necessary. TheCAST
functions in this scenario maybe have some different behaviors. The flagInUnionStmt
which is useful to cover some corner case in CAST functions implementation in the coprocessor, so we should pushdown relatedFlag
to the coprocessor.What is changed and how it works?
This PR overwrite the
implicitParameters
forbaseBuiltinCastFunc
to push theinUnion
flag.Check List
Tests