Conversation
`SSSSSSSS` was missing from `JAVA_DATE_FORMAT_TOKENS`, so it tokenized as `SSSSSSS` followed by `S`, giving two consecutive subsecond components. The first consumed every digit and the second found none, so every input failed with "the 'subsecond' component could not be parsed". One to nine `S` all work except eight. Generated with Claude Opus 5 (Claude Code).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SSSSSSSSis missing fromJAVA_DATE_FORMAT_TOKENS. The tokenizer walks that list in order and takes the first match, so eightSmatchedSSSSSSSand left oneSover, producing two consecutive subsecond components.build_fraction_of_second_itemusesSubsecondDigits::OneOrMore, so the first one consumes every digit and the second finds none:Every width from one to nine
Sworks except eight, for any input:Scount2024-01-02 03:04:05.123456789That asymmetry is why this reads as an omission rather than a deliberate limit — the digit count is ignored everywhere else, since all widths map to the same
OneOrMoreitem.How was this PR tested?
test_parse_java_datetime_format_every_subsecond_widthloops one to nine and parses the same nanosecond input with each. Onmainit fails at eight; with the fixcargo test -p quickwit-datetimeis 35 passing, clippy clean.No nightly toolchain here and
rustfmt.tomlis nightly-only, so I kept the new match arm under 100 columns by hand rather than running stablecargo fmtover the file — please let the CI format check be the judge, as on #6767.Written by Claude Opus 5 in Claude Code, running under my account.