Repository navigation
Fix best effort DT parsing on NULL strings - #108310
Conversation
|
Workflow [PR], commit [1ed4ce0] Summary: ✅
AI ReviewSummaryThis PR restores parseable nested string data for null-masked Missing context / blind spots
Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 12/16 (75.00%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
|
📊 Cloud Performance Report ✅ AI verdict: This change is a narrow correctness fix in DateTime/Time-to-String conversion that skips empty strings at NULL positions and falls back to UTC when no timezone is set. The only flagged result, clickbench Q15 (an integer GROUP BY with no datetime-to-string conversion), exercises none of the touched code, so its 11.55% "improvement" is run-to-run variance rather than a real PR effect and has been downgraded. No genuine performance impact is expected from this fix. clickbenchFlagged queries (1 of 43)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
…TimeBestEffort-nullable Fix best effort DT parsing on NULL strings
`FunctionConvert` handles `Nullable` arguments itself and ran the conversion over every row, including the rows behind a NULL, whose nested value is the empty string. The generic String path tolerates that because under a `Nullable` result it parses in NULL-on-error mode, but the `DateTime64` and `Time64` branches parse in throwing mode. With `cast_string_to_date_time_mode = 'basic'` an empty string parses to 0, which hid the problem; since ClickHouse#89334 made `best_effort` the default (26.6), `toDateTime64(s, 3)` over a `Nullable(String)` column with a NULL row throws `CANNOT_PARSE_DATETIME`. `toTime64` throws on the empty string in every mode, so it failed the same way before that. For String and FixedString conversions to `DateTime64` and `Time64`, filter the NULL rows out before parsing and expand the result back, the same short-circuit the default implementation for NULLs applies to functions that cannot be executed on default arguments (`IFunction.h`). A non-NULL value that cannot be parsed still throws. Columns without NULL rows keep the old path. Related: ClickHouse#108176 Related: ClickHouse#108310 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes parseDateTimeBestEffort with timezone throwing CANNOT_PARSE_DATETIME on NULL rows of toString(Nullable(DateTime64)). Closes #108176
Version info
26.6.1.1185