You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Micah Kornfield <em...@gmail.com> on 2020/08/01 02:36:35 UTC

Re: [Gandiva] Additional types supported by abs, ceil, floor, etc.

Hi Troy,
I'm not an expert on gandiva but it does seem like having these
functions for floating point/integer types makes sense (I'm surprised they
aren't included already).

Using the same output type as input types also makes sense (this seems
consistent with both SQL and std library functions as far as I can tell).

Thanks,
Micah

On Sun, Jul 26, 2020 at 11:18 AM Troy Zimmerman <ta...@me.com.invalid>
wrote:

> Apologies for the noise, but would it make sense if the functions returned
> the same type as the parameter to improve composition with other functions
> & operators? My examples might be a hassle to use as-is.
>
> > On Jul 26, 2020, at 1:10 PM, Troy Zimmerman <ta...@me.com.INVALID>
> wrote:
> >
> > Hi,
> >
> > Would it be possible to support additional types in the following
> functions, or are they purposefully limited to decimal128? Naively, I
> assume the following make sense:
> >
> > abs(float64) -> float64
> > abs(int64) -> int64
> > ceil(float64) -> int64
> > floor(float64) -> int64
> > trunc(float64) -> int64
> > round(float64, int32) -> int64
> >
> > The reason I ask is that when using the Python API, I have to wrap float
> arguments with a cast to decimal when building & evaluating expressions.
> The result array is also decimal128, which is an object dtype when
> converted to pandas/numpy, so it would be convenient (and perhaps more
> efficient?) to have float64 versions of the functions.
> >
> > Thank you for your effort. The arrow ecosystem is really impressive.
> >
> > Best,
> > Troy
>
>