apache / apache/arrow

[R] Update as.Date() to support direct casting from double/float

Open
#31,248 0 comments 0 reactions 0 assignees View on GitHub
Component: R Type: task
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 20h
Merged PRs (30d)
94

Description

This might need support from C++ as, at present, it is not possible to cast directly from a double. Currently, we are flooring the double to an integer as an intermediate step.

**Reporter**: [Dragoș Moldovan-Grünfeld](https://issues.apache.org/jira/browse/ARROW-15807) / @dragosmg
#### Related issues:
- [[R][C++] Discussion: Plans for date casting from int to support an origin option?](https://github.com/apache/arrow/issues/31240) (depends upon)

**Note**: *This issue was originally created as [ARROW-15807](https://issues.apache.org/jira/browse/ARROW-15807). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by reading the current R as.Date() casting behavior and the related issue ARROW-15807, then review the dependent discussion in issue #31240 for the C++ requirements. Done means as.Date() can cast double and float values directly without flooring them to an integer first, with the R and C++ behavior aligned.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.