apache / apache/arrow

[C++] Support Temporal Extraction Functions for duration types

Open
#33,962 12 comments 0 reactions 0 assignees View on GitHub
Component: C++ Component: Python good-second-issue Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

### Describe the enhancement requested

```
In [2]: import datetime

In [3]: import pyarrow as pa

In [4]: pa.__version__
Out[4]: '10.0.1'

In [5]: pa.compute.day(pa.array([datetime.timedelta(1)]))
ArrowNotImplementedError: Function 'day' has no kernel matching input types (duration[us])
```

Would be great to support extracting the `day`, `second`, `microseconds`, `nanoseconds` components of a timedelta

### Component(s)

Python

Contributor guide

Open the contributing guide

Research direction

Start from the Python reproduction in the issue and trace the pyarrow compute implementation for temporal extraction functions. Identify how duration inputs are handled for day, second, microseconds, and nanoseconds, then add coverage showing these functions work for timedelta arrays.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.