-
Notifications
You must be signed in to change notification settings - Fork 3.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
colexec: implement vectorized version of NotExpr #70713
Comments
@yuzefovich I am new to cockroachdb, but I would like to contribute for this issue. Please assign it to me. |
Thanks for your interest @amitech! Let me know if you need some guidance / more pointers. |
Sure, thanks @yuzefovich. |
Hello, is this issue being actively worked on? I would be happy to give it a try if it's OK. Thanks! |
@jlevesy thanks for your interest! @amitech has volunteered to work on this issue, so I want to give them more time. However, there is another issue of similar complexity that you might be interested in #66015 (it's currently assigned to my colleague, but I'm sure he'll be happy to give it away :) ). |
Awesome, thanks! :) |
Hi @yuzefovich , is this issue still under progress? I can see that it was assigned back in Sept 2021 and is still open. I would like to work on it if its alright to do so. I have gone through the suggestions that you mentioned and am able to form a rough outline of the changes that might be required. |
Thanks @yuzefovich! Before I proceed, I wanted to validate my understanding and clear a few doubts. Given your initial explanation, I think the task involves:
In case there are potential gaps in my understanding outlined above (likely at this point :) ), please do help me in rectifying them. Assuming the above explanation is correct, I had the following doubts pertaining to the implementation:
|
@RajivTS I think you're understanding of the task is right on the point! I'll address each of the questions/doubts below. Let me know if you have other questions.
Let's think through what
More concretely, you'll have something like this:
No, that thing is specific to IS NULL. I mentioned
We don't need to do anything like this. |
Thank you for the detailed explanation @yuzefovich! I think I have sufficient grasp of the requirement at this point to begin the implementation and will let you know as soon as I make some progress. In the meantime, I just wanted to get confirmation on the intended behavior for select:
|
Yes, that sounds right. Selection operators only include values for which the expression evaluates to |
Hi @yuzefovich I have made the initial set of changes based on my understanding and have raised a draft PR in my own fork. Please review it and let me know if any changes need to be made. The PR also contains a commented-out test case which was failing despite no faults in the underlying implementation. I believe the |
Thanks for working on this! In order for me to review your code, please open up the PR against Re: |
Currently,
tree.NotExpr
is not implemented natively in the vectorized engine, so we have to fallback to the older row-by-row engine to evaluate it. We should, instead, vectorizeNotExpr
.I think the implementation will be quite similar to how
tree.IsNullExpr
is implemented, and I think we will want to implement two versions ofNotExpr
operator:coldata.Vec
with values equal to evaluatingNOT
predicate on each row in anothercoldata.Vec
(while paying attention to nulls in the input vector and the selection vector on the input batch)NOT
predicate evaluated totrue
.Some code pointers:
colbuilder/execplan.go
inplanProjectionOperators
andplanSelectionOperators
tree.NotExpr
lives insem/tree/expr.go
tree.IsNullExpr
lives incolexec/is_null_ops.eg.go
(which is automatically generated based oncolexec/is_nulls_ops_tmpl.go
andcolexec/execgen/cmd/execgen/is_nulls_ops_gen.go
).Please let me know if more guidance is needed.
Jira issue: CRDB-10187
The text was updated successfully, but these errors were encountered: