Skip to content

Strings with dates less then 1970-01-01 are infered as Date time and saved as 1970-01-01 in text formats schema inference #86025

@Avogar

Description

@Avogar

Company or project name

ClickHouse Inc.

Describe what's wrong

If a column in text format contain dates less then 1970-01-01 it's inferred as Date type and converts such values to default 1970-01-01 date

Does it reproduce on the most recent release?

Yes

How to reproduce

:) select * from format(JSONEachRow, '{"d" : "1920-01-01"}');

SELECT *
FROM format(JSONEachRow, '{"d" : "1920-01-01"}')

Query id: 18c3c895-8676-402d-8e40-ca1a93ce2da3

   ┌──────────d─┐
1. │ 1970-01-01 │
   └────────────┘

Expected behavior

It should be inferred as String or as Date32

Error message and/or stacktrace

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions