Skip to content

[cdc] Fix pre-epoch values in temporal computed columns with micro and nanosecond precision - #11184

Open
chenjian2664 wants to merge 1 commit into
apache:masterfrom
chenjian2664:chenjian2664/bytequay/fix-pre-epoch-cdc-temporal-computed-columns
Open

chenjian2664 wants to merge 1 commit into
apache:masterfrom
chenjian2664:chenjian2664/bytequay/fix-pre-epoch-cdc-temporal-computed-columns

Conversation

@chenjian2664

Copy link
Copy Markdown
Contributor

Purpose

Temporal computed columns with epoch precision 6 or 9, such as year(col, 6) or date_format(col, yyyy-MM-dd, 9), throw IllegalArgumentException for a negative epoch value with a sub-millisecond part, for example -1500 microseconds. This stops the CDC sync job on the first pre-1970 record. The epoch value was split into milliseconds and nanos-of-millisecond with truncating division, which gives a negative remainder that Timestamp rejects; it now uses floor division and modulo.

Tests

…d nanosecond precision

Temporal computed columns split epoch microseconds and nanoseconds with
truncating division, so a negative value with a sub-millisecond part
produced a negative nanos-of-millisecond and Timestamp rejected it. Use
floor division and modulo so pre-1970 values convert correctly.
@chenjian2664
chenjian2664 marked this pull request as ready for review November 16, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant