Repository navigation
Add test: Time and DateTime string parse failure paths in JSONExtractTree lack test coverage - #105050
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [1c1b550] Summary: ✅ AI ReviewSummaryThis PR adds a new stateless test pair ( Final VerdictStatus: ✅ Approve |
Style check rejects test names containing 'fail'. Renamed: - 04240_json_extract_time_string_parse_failure.sql → 04240_json_extract_invalid_time_string.sql - 04240_json_extract_time_string_parse_failure.reference → 04240_json_extract_invalid_time_string.reference Requested by @alexey-milovidov in ClickHouse#105050 (comment)
6509a59 to
4ecde0a
Compare
Lines 17-19 used plain `DateTime` which outputs `1970-01-01 00:00:00`
only in UTC sessions; non-UTC servers would format with offset.
Changed to `DateTime('UTC')` so the reference is deterministic.
Requested by @clickhouse-gh[bot] in ClickHouse#105050 (comment)
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #102690.
That PR PR #102690 fixes inserting into Time data type during JSON parsing by adding Int64 support to TimeNode and DateTimeNode. The changes (1) modify the condition from
isUInt64()toisInt64() || isUInt64()to accept both integer types, (2) add error handling for negative Int64 values in DateTime, and1.
TimeandDateTimestring parse failure paths inJSONExtractTreelack test coveragesrc/Formats/JSONExtractTree.cpp:784,src/Formats/JSONExtractTree.cpp:713Risk: The call chain is: JSONExtract → TimeNode::insertResultToColumn → element.isString() TRUE → tryParse fails → error set → return false at line 784. Risk: if
return falseis accidentally removed, theWhat's unique vs PR tests: PR test 04094 covers valid Time string parsing ('12:30:45' → 12:30:45). This test covers invalid Time string parsing ('not-a-time' → 00:00:00 default) - the failure path at line 784 that PR tests don'
Tags:
-- Tags: no-fasttest—no-fasttest: Time type requires enable_time_time64_type which is not available in fast test buildTry it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Version info
26.5.1.834