Skip to content

GH-54647: [C++] Reject leap seconds in the strptime timestamp parser - #54659

Closed
pearu wants to merge 1 commit into
apache:mainfrom
pearu:pearu/strptime-leap-seconds
Closed

pearu wants to merge 1 commit into
apache:mainfrom
pearu:pearu/strptime-leap-seconds

Conversation

@pearu

@pearu pearu commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

strptime accepts a seconds value of 60 (glibc also 61), and the parser added it to the time of day, which wrapped it into the next minute. Arrow cannot represent leap seconds, and the ISO-8601 parser rejects them.

What changes are included in this PR?

The parser rejects a seconds value of 60 or more. The check applies only when the time of day is used, so Gandiva's to_date, which ignores the time, still accepts such values.

Are these changes tested?

Yes, in TimestampParser.StrptimeParser, and a Gandiva to_date test checks that a leap second still gives the date when the time is ignored.

Are there any user-facing changes?

Leap seconds no longer parse with strptime formats, except in Gandiva's to_date.

AI usage disclosure

Developed with AI assistance (Claude Code): the fix, the tests and this description were AI-generated under my direction and reviewed line by line by me. I own and can debug these changes. No copyrighted material is included.

…arser

strptime accepts a seconds value of 60 (glibc also 61), and the parser added
it to the time of day, wrapping it into the next minute. Arrow cannot
represent leap seconds, and the ISO-8601 parser rejects them, so reject them
here too. The check applies only when the time of day is used, so Gandiva's
to_date, which ignores the time, still accepts such values.

Drafted by Claude Code (an AI agent) and reviewed & approved by pearu.
@github-actions github-actions Bot added the awaiting review Awaiting review label Oct 19, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #54647 has been automatically assigned in GitHub to PR creator.

@github-actions

Copy link
Copy Markdown

Thanks for opening a pull request!

This pull request has been automatically closed because you currently have 4 open pull requests, which is more than the limit of 3.

Due to the increase in pull requests opened by AI bots, and in order to keep the review queue manageable, Apache Arrow limits contributors without repository access to at most 3 concurrently open pull requests. This helps make sure each pull request gets the attention it needs and that work in progress does not go stale.

Once one of your other open pull requests has been merged or closed, you are welcome to reopen this one.

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant