hi Ian — I agree with implementing these functions with
varargs/variadic inputs (this was my original intent when drafting
compute/kernel.h and related machinery last year).

As one nuance with the way that things work right now, the type
matching infrastructure isn't necessarily able to determine whether
varargs inputs are compatible with each other — the type matching rule
considers each argument independently

https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernel.cc#L411

There may be other places to address this type correspondence, but if
it were deemed useful to better support variadic argument validation,
we could probably fairly easily generalize the TypeMatcher API so that
it can "see" the types of the other arguments.

Thanks,
Wes

On Thu, Jun 17, 2021 at 5:59 PM Ian Cook <i...@ursacomputing.com> wrote:
>
> Arrow developers,
>
> A couple of recent PRs have added new variadic scalar kernels to the
> Arrow C++ library (ARROW-12751, ARROW-12709). There were some
> questions raised in comments on Jira and GitHub about whether these
> could instead be implemented as unary or binary kernels that take
> ListArray or StructArray input. Since I believe we plan to add at
> least a few more variadic kernels, I wrote a document [1] with help
> from some colleagues at Ursa to describe the rationale behind why we
> believe it is best to implement these as variadic kernels. Feedback is
> welcome.
>
> Thank you,
> Ian
>
> [1] 
> https://docs.google.com/document/d/1ExysJ43WpjZ_P6vnfx6dzCRSvM-3qlqpc6gPjy9cNXM/

Reply via email to