-
Notifications
You must be signed in to change notification settings - Fork 66
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
Conversation
90dbe4b
to
629b838
Compare
} else { | ||
errs.AddRange(0, uint64(vec.Len())) | ||
} | ||
} |
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.
Is the absence of a default case here intentional?
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 panic
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.
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
// 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 |
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.
What does this change have to do with implementing conditionals?
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.
Just figured not to have two different boolMask functions plus the new one is more optimized
629b838
to
bac0723
Compare
bac0723
to
d272f8b
Compare
No description provided.