Repository navigation
Conversation
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
Split the shared timestamp parser change out of #19533 so its server behavior can be reviewed independently.
DateTimeUtils.convertDatetimeStrToLongis used by tree SQL time literals, table SQL time literals and string-to-TIMESTAMPcasts, and Pipe source start/end time parameters. The table CSV changes in #19533 depend on this parser.An offset-free timestamp now uses the configured zone's rules for the date in the input. An explicit offset determines the instant directly. The parser also consumes the entire input, and conversion to nanoseconds avoids intermediate overflow at the lower limit.
Behavior changes
2026-07-01T12:00:00with session zoneAmerica/New_York, parsed in December-05:00offset and stored2026-07-01T17:00:00Z-04:00offset and stores2026-07-01T16:00:00Z. A January noon still resolves to17:00:00Z.CAST('2026-12-04T03:33:17.083Zjunk' AS TIMESTAMP)2026-12-04T03:33:17.083Zafter discardingjunk1970-01-01T00:00:00zor1970-01-01T08:00:00+08:00:00zand second-precision offsets0. Nonzero offset seconds are honored too, so1970-01-01T08:00:15+08:00:15also resolves to0.1999-02-29T00:00:00.000in UTC1999-02-29T00:00:00.000+00:001999-02-29T00:00:00.000and still explains that 1999 is not a leap year.1677-09-21T00:12:43.145224192Zat nanosecond precision-9223372036854775808(Long.MIN_VALUE). One nanosecond earlier,1677-09-21T00:12:43.145224191Z, still raisesArithmeticException.Validation
DateTimeUtilsTestcovers the explicit offsets, invalid-date diagnostic and nanosecond boundary.IoTDBDatetimeFormatITandIoTDBDatetimeFormatTableITcover tree and table SQL time literals in winter and summer, casting a string column toTIMESTAMPin the same session zone, and rejecting a cast with trailing text.The parser, statement generator and cast unit suites passed locally (88 passed, one existing ignored test). All 7 tests in the two integration test classes passed on a local standalone cluster (3 tree, 4 table). Spotless and the integration test selection check passed.