Skip to content

JSONEachRow rejects float as DateTime64 (works in Values) #59443

Description

@pkit

A JSON number with a fractional part (1703363853.035) is rejected when inserted into a DateTime64 column via JSONEachRow, even though the docs advertise that floating-point epochs cast to DateTime64. The Values format accepts the same number, JSONEachRow does not. date_time_input_format = 'best_effort' does not change the behaviour. The error is CANNOT_PARSE_INPUT_ASSERTION_FAILED at the decimal point.

Reproduction

https://fiddle.clickhouse.com/cf19e460-2811-48f2-915c-9e0d4e1d8312

SELECT * FROM format(Values, 't DateTime64(3)', '(1703363853.035)'); -- OK
SELECT * FROM format(JSONEachRow, 't DateTime64(3)', '{"t":1703363853}'); -- OK
SELECT * FROM format(JSONEachRow, 't DateTime64(3)', '{"t":1703363853.035}'); -- Not OK
Code: 27. DB::Exception: Cannot parse input: expected ',' before: '.035}': (at row 1)
: While executing ParallelParsingBlockInputFormat. (CANNOT_PARSE_INPUT_ASSERTION_FAILED)
(query: SELECT * FROM format(JSONEachRow, 't DateTime64(3)', '{"t":1703363853.035}');)

Version

Current master (26.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed user-visible misbehaviour in official releasecomp-datetimeDate/DateTime/TimeZone datatypes and date-time semantics.comp-formatsInput/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions