expr: BinaryFunc to use variadic input types#35033
Merged
antiguru merged 3 commits intoMaterializeInc:mainfrom Feb 17, 2026
Merged
expr: BinaryFunc to use variadic input types#35033antiguru merged 3 commits intoMaterializeInc:mainfrom
antiguru merged 3 commits intoMaterializeInc:mainfrom
Conversation
Pre-merge checklist
|
efde6e7 to
2f15555
Compare
Support tuples as parameters to sql functions. Use the new API for binary functions. Signed-off-by: Moritz Hoffmann <mh@materialize.com>
Signed-off-by: Moritz Hoffmann <mh@materialize.com>
2f15555 to
0233224
Compare
petrosagg
reviewed
Feb 17, 2026
src/expr/src/scalar/func/binary.rs
Outdated
| let a = a.eval(datums, temp_storage)?; | ||
| let b = b.eval(datums, temp_storage)?; | ||
| let a = match T::Input1::try_from_result(Ok(a)) { | ||
| validate_arity::<T>(exprs.len()); |
Contributor
There was a problem hiding this comment.
This seems redundant with the assert_none!() afterwards. If the assert_none!() passes then it means that the call had exactly the right amount of datums in it, right?
Member
Author
There was a problem hiding this comment.
Yeah, I'm undecided what's the best way to assert that we don't accidentally drop datums on the floor, and whether it's a reason to panic (I think yes) or produce an error (I think no).
We should call functions with correct parameters, instead of asserting where it's too late. Signed-off-by: Moritz Hoffmann <mh@materialize.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Switch binary functions to a single variadic input type. Instead of defining two input GATs, we define a single one, which we fix to be a tuple of two elements. This is a step toward unifying all function types.