-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: implement vectorized evaluation for builtinCastIntAsDurationSig
#12042
expression: implement vectorized evaluation for builtinCastIntAsDurationSig
#12042
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 |
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
expression/builtin_cast_vec.go
Outdated
i64s := buf.Int64s() | ||
ds := result.GoDurations() | ||
for i := 0; i < n; i++ { | ||
if buf.IsNull(i) { |
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.
Can MergeNulls be used instead of this?
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.
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
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.
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) |
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.
Should the warning message be refined like this.
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.
In its row-based implementation, this error is not refined.
to #12058 |
@qw4990 any update? |
…stIntAsDurationSig
/run-unit-test |
/run-all-tests |
PTAL @XuHuaiyu |
…stIntAsDurationSig
…stIntAsDurationSig
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
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
/run-all-tests |
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