[C++] temporal addition and subtraction with integers
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
`date64 + intX` would be equivalent to `date64 + intX->cast(duration(unit = "d"))` (I guess this is tricky since "s" is the largest duration unit? but date64 is an integer underneath, we should be able to add another integer to it)
`timestamp[ms] + intX` would be equivalent to `timestamp[ms] + intX->cast(timestamp(unit = "ms"))`
etc.
Multiplication and division probably don't make sense, but addition and subtraction do, at least saves you the trouble of having to convert to a Duration first.
**Reporter**: [Neal Richardson](https://issues.apache.org/jira/browse/ARROW-17043) / @nealrichardson
**Note**: *This issue was originally created as [ARROW-17043](https://issues.apache.org/jira/browse/ARROW-17043). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start by locating the C++ implementations and tests for arithmetic on date64 and timestamp[ms] values. Review how duration and timestamp casts currently work, then define and test addition and subtraction with integer operands, including the unit behavior described in the issue. Done means the supported temporal types accept these operations with matching results and the tests cover them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100