clickhouse: fix date overflow for initial load#4534
Conversation
| // Timestamps are micros since epoch; dates are days since epoch. Both encoded as Avro varint. | ||
| avroVal := t.UnixMicro() | ||
| if isDate { | ||
| avroVal = t.Unix() / 86400 |
There was a problem hiding this comment.
had to move it here out of process[type] functions because we clamp t value for clickhouse
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ 8 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 2 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
❌ Test FailureAnalysis: A deterministic assertion failure in Test_MySQL_DateTime_ClickHouse_Range (expected nil but got 1900-01-01) reproduces identically across all MySQL/MariaDB matrix variants, indicating the PR's own date-overflow fix is incomplete rather than a flaky failure. |
❌ Test FailureAnalysis: Real bug: the PR's own test Test_MySQL_DateTime_ClickHouse_Range deterministically fails across all 4 CH suites and both matrix jobs with a clear value mismatch (out-of-range nullable DATE replicated as 1900-01-01 instead of NULL), with no timeout/race/network signals. |
parseDateTime64BestEffortOrNull (used by the CDC normalize path) saturates out-of-range values to ClickHouse's [1900, 2299] boundary, clamping the date while preserving the time-of-day, and never nulls. Make the snapshot/Avro path do the exact same thing so snapshot and CDC stay consistent for the same source value, regardless of column nullability. Verified the Go clamp matches parseDateTime64BestEffortOrNull output exactly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ Test FailureAnalysis: The PR's own new test Test_MySQL_DateTime_ClickHouse_Range fails deterministically with a logic assertion ("expected out-of-range nullable DATE to be NULL") across all 4 ClickHouse suite variants and all 3 matrix jobs, indicating the date-overflow fix is genuinely broken rather than flaky. |
❌ Test FailureAnalysis: Real bug: Test_MySQL_DateTime_ClickHouse_Range fails deterministically across every matrix leg with an identical out-of-range datetime overflow (expected 2299-12-31 but got wrapped-around 1715-06-12), indicating a MySQL→ClickHouse datetime range-boundary conversion defect, not a flaky/timeout/race failure. |
No description provided.