-
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: implement vectorized evaluation for builtinLocate3ArgsSig
#12510
Conversation
/run-unit-test |
Codecov Report
@@ Coverage Diff @@
## master #12510 +/- ##
===========================================
Coverage 80.1145% 80.1145%
===========================================
Files 464 464
Lines 106500 106500
===========================================
Hits 85322 85322
Misses 14992 14992
Partials 6186 6186 |
…-builtinLocate3ArgsSig
/run-unit-test |
…-builtinLocate3ArgsSig
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
result.MergeNulls(buf, buf1) | ||
i64s := result.Int64s() | ||
for i := 0; i < n; i++ { | ||
if result.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.
Consider this case, b.args[2] is null but the result is not null.
mysql> SELECT LOCATE('bar', 'foobarbar', NULL);
+----------------------------------+
| LOCATE('bar', 'foobarbar', NULL) |
+----------------------------------+
| 0 |
+----------------------------------+
1 row in set (0.00 sec)
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.
My test result is correct
mysql> SELECT LOCATE('bar', 'foobarbar', NULL);
+----------------------------------+
| LOCATE('bar', 'foobarbar', NULL) |
+----------------------------------+
| NULL |
+----------------------------------+
1 row in set (0.00 sec)
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 args[0] and args[1] be null?
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.
yes, any args is null will result in null
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.
Consider this case, b.args[2] is null but the result is not null.
mysql> SELECT LOCATE('bar', 'foobarbar', NULL); +----------------------------------+ | LOCATE('bar', 'foobarbar', NULL) | +----------------------------------+ | 0 | +----------------------------------+ 1 row in set (0.00 sec)
In MySQL 8.x, this SQL returns NULL
.
…1sh/tidb into vecexpr-builtinLocate3ArgsSig
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
Your auto merge job has been accepted, waiting for 12662 |
/run-all-tests |
What problem does this PR solve?
Implement vectorized evaluation for
builtinLocate3ArgsSig
.12106
What is changed and how it works?
Check List
Tests