-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix string view LIKE checks with NULL values #6662
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
Merged
alamb
merged 5 commits into
apache:master
from
findepi:findepi/fix-string-view-like-checks-with-null-values-1121b8
Nov 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d3e42a5
Fix string view LIKE checks with NULL values
findepi 65d52ff
Add TODO comments to operations yet to be fixed
findepi 1e82884
Use from_unary for contains with string view
findepi bede692
Fix performance
findepi 2394f92
fixup! Fix performance
findepi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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 concern with this approach is that it adds code to the inner loop of the kernel.
We should definitely run benchmarks on this PR before merging
I think another way to solve this would be to either:
nullswasSomeand the other whennullswasNone(so we aren't checking each row)Nullsarray from the input to the output (so any input that wasnullwould also benullin the output)Uh oh!
There was an error while loading. Please reload this page.
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.
FWIW I am not sure why this isn't using from_unary like the other codepaths which would provide option 2, and be significantly more efficient than first collecting into a Vec...
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 now i am more concerned about correctness. Producing fast but wrong results isn't as useful.
i changed contains to to use
from_unary, that seemed trivially good.@tustvold might this be it doesn't use
from_unarybecause it wants to useprefix_bytes_iterandsuffix_bytes_iter? Please advise! I think we can switch all operations tofrom_unaryto fix correctness and leave tuning performance to a follow-up.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 am running some benchmarks to see what, if any, impact this has in performance
I will report back shortly
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.
It looks like there are some non trivial regressions (50%) or utf8view with scalar starts/ends.
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 did run benchmarks locally too. Thanks @alamb for the instructions.
First, on the commit 1621350 where the PR branch starts
then on 1e82884, the tip of the PR branch
This command runs bechmark and produces comparison. Let me omit low changes (below 9%) for brevity, as well as outliers reporting.
significant performance regressions:
significant performance improvements:
TL;DR
i must be doing something wrong here. the benchmarks report improvement for code path i didn't change.
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.
the results are apparently repeatable on my laptop
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.
okay, easy to fix, actually
Uh oh!
There was an error while loading. Please reload this page.
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.
pushed performance-oriented changes
i still observe a regression for one case
and still see improvements for many ilike cases e.g.
i don't think i know how to move it further from here. @alamb @tustvold ptal
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.
Checking it out