apache / apache/arrow

[C++][R] strptime fails to parse with %b or %B on Windows

Open
#31,816 4 comments 0 reactions 0 assignees View on GitHub
Component: C++ Component: R Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

The following works on macOS
```r

library(arrow, warn.conflicts = FALSE)

a <- Array$create("2021 September 13")
call_function("strptime", a, options = list(format = "%Y %B %d", unit = 0L))
#> Array
#>
#> [
#> 2021-09-13 00:00:00
#> ]
```
but fails on Windows, with:

```r

#> Error: Invalid: Failed to parse string: '2021 September 13' as a scalar of type timestamp[s]
```
I came across this while implementing the `parse_date_time()` bindings, when the Windows CI jobs were failing to parse date with the months expressed either as name or short name.

**Reporter**: [Dragoș Moldovan-Grünfeld](https://issues.apache.org/jira/browse/ARROW-16443) / @dragosmg
**Watchers**: [Rok Mihevc](https://issues.apache.org/jira/browse/ARROW-16443) / @rok
#### Related issues:
- [[C++] Strptime issues umbrella](https://github.com/apache/arrow/issues/31324) (is a child of)
- [[C++][Python] strptime fails to parse with %p on Windows](https://github.com/apache/arrow/issues/31971) (is related to)

**Note**: *This issue was originally created as [ARROW-16443](https://issues.apache.org/jira/browse/ARROW-16443). 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 running the provided R call_function("strptime") reproduction on Windows and compare it with macOS behavior. Trace the strptime path involved by the parse_date_time() bindings and use the linked Windows CI failure as context. Done means %b and %B parse month names consistently on Windows without breaking the shown timestamp result.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.