expression: implement vectorized evaluation for builtinCastIntAsDurationSig #12042
Merged
sre-bot merged 11 commits intopingcap:masterfrom Sep 17, 2019
Merged
expression: implement vectorized evaluation for builtinCastIntAsDurationSig #12042sre-bot merged 11 commits intopingcap:masterfrom
builtinCastIntAsDurationSig #12042sre-bot merged 11 commits intopingcap:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12042 +/- ##
===========================================
Coverage 81.1424% 81.1424%
===========================================
Files 454 454
Lines 98438 98438
===========================================
Hits 79875 79875
Misses 12822 12822
Partials 5741 5741 |
XuHuaiyu
reviewed
Sep 6, 2019
expression/builtin_cast_vec.go
Outdated
| i64s := buf.Int64s() | ||
| ds := result.GoDurations() | ||
| for i := 0; i < n; i++ { | ||
| if buf.IsNull(i) { |
Contributor
There was a problem hiding this comment.
Can MergeNulls be used instead of this?
Member
There was a problem hiding this comment.
For this case, we need to copy the null bitmap from buf to result. I think we can add an interface to do it. @qw4990
Contributor
Author
There was a problem hiding this comment.
We already have such an interface MergeNulls and it is used here now.
| dur, err := types.NumberToDuration(i64s[i], int8(b.tp.Decimal)) | ||
| if err != nil { | ||
| if types.ErrOverflow.Equal(err) { | ||
| err = b.ctx.GetSessionVars().StmtCtx.HandleOverflow(err, err) |
Contributor
There was a problem hiding this comment.
Should the warning message be refined like this.
Contributor
Author
There was a problem hiding this comment.
In its row-based implementation, this error is not refined.
Member
|
to #12058 |
Member
|
@qw4990 any update? |
…stIntAsDurationSig
Contributor
Author
|
/run-unit-test |
Contributor
Author
|
/run-all-tests |
Contributor
Author
|
PTAL @XuHuaiyu |
…stIntAsDurationSig
…stIntAsDurationSig
Contributor
|
/run-all-tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Implement vectorized evaluation for
builtinCastIntAsDurationSig.What is changed and how it works?
10% faster than before:
Check List
Tests