Skip to content
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

vam: Add support for conditionals (case expr) #5494

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Conversation

mattnibs
Copy link
Collaborator

No description provided.

@mattnibs mattnibs requested a review from a team November 21, 2024 15:39
@mattnibs mattnibs force-pushed the vam-conditional branch 2 times, most recently from 90dbe4b to 629b838 Compare November 21, 2024 15:43
@mattnibs mattnibs changed the title vam: Add support for conditionals (case exprs) vam: Add support for conditionals (case expr) Nov 21, 2024
} else {
errs.AddRange(0, uint64(vec.Len()))
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the absence of a default case here intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 should panic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought I don't think it should. Have no default just sets the return value to false for non-bool vectors just like vector.BoolValue does

Comment on lines +34 to +42
// errors are ignored for filters
b, _ := expr.BoolMask(mask)
if b.IsEmpty() {
return nil, false
}
if len(index) == int(n) {
if b.GetCardinality() == uint64(mask.Len()) {
return vec, true
}
return vector.NewView(vec, index), true
return vector.NewView(vec, b.ToArray()), true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change have to do with implementing conditionals?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just figured not to have two different boolMask functions plus the new one is more optimized

@mattnibs mattnibs requested a review from nwt November 22, 2024 13:52
@mattnibs mattnibs merged commit b74d0b4 into main Nov 22, 2024
3 checks passed
@mattnibs mattnibs deleted the vam-conditional branch November 22, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants