apache / apache/arrow

[C++][Python] Floordiv compute kernel

Open
#39,386 2 comments 0 reactions 0 assignees View on GitHub
Component: C++ Component: Python Status: needs champion Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

Python and numpy support floor division, which for integral types, round towards infinity (pa.compute.divide for integral types rounds towards 0). If one of the types if floating point, then floordiv is equivalent to pa.compute.floor(pa.compute.divide), however, if both types are integral, floordiv should round towards infinity instead of 0. To do this currently, requires a combination of multiple compute calls, such as in https://github.com/pandas-dev/pandas/pull/56677. Since python and numpy support this, would be useful to have this logic in an arrow compute kernel.

### Component(s)

C++, Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.