-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Different behavior of cast('0' as DateTime64(3)) and cast('0' as Nullable(DateTime64(3))) #56285
Copy link
Copy link
Closed
Labels
potential bugTo be reviewed by developers and confirmed/rejected.To be reviewed by developers and confirmed/rejected.
Description
Describe what's wrong
Difference behavior of cast('0' as DateTime64(3)) and cast('0' as Nullable(DateTime64(3))). I believe it is a bug introduced in pr: #55146
ClickHouse Version: head
:) select cast('0', 'Nullable(DateTime64(3))');
SELECT CAST('0', 'Nullable(DateTime64(3))')
Query id: 89e0ddbc-dc6d-497e-88d3-912d2596e640
┌─CAST('0', 'Nullable(DateTime64(3))')─┐
│ 1970-01-01 08:00:00.000 │
└──────────────────────────────────────┘
1 row in set. Elapsed: 0.049 sec.
:) select cast('0', 'DateTime64(3)');
SELECT CAST('0', 'DateTime64(3)')
Query id: e505d9c8-6a81-43fb-87ce-f2b6f644a9cb
Elapsed: 0.101 sec.
Received exception from server (version 23.10.1):
Code: 41. DB::Exception: Received from localhost:9001. DB::ParsingException. DB::ParsingException: Cannot parse DateTime: While processing CAST('0', 'DateTime64(3)'). (CANNOT_PARSE_DATETIME)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
potential bugTo be reviewed by developers and confirmed/rejected.To be reviewed by developers and confirmed/rejected.