RFC: Encode Scalars as dyn Any
in Scalar dyn Kernels
#2842
Labels
enhancement
Any new improvement worthy of a entry in the changelog
dyn Any
in Scalar dyn Kernels
#2842
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
As expanded upon in #2837 currently the encoding of scalars in dyn kernels is inconsistent. The arithmetic kernels must be explicitly type hinted with the
ArrowPrimitiveType
, whilst the comparison kernels coerce the scalar type to the desired type.Taking a step back, users just want to give a kernel an array and a scalar of the correct type and have it work, with all the dispatch logic handled for it.
Describe the solution you'd like
I would like to suggest encoding scalars as
& dyn std::any::Any
, for example,Users can then write
This has the following advantages:
The only major downside is that users will need to be careful to correctly hint scalar types, i.e.
&1_i64
.Describe alternatives you've considered
We could not do this
Additional context
The text was updated successfully, but these errors were encountered: