-
Notifications
You must be signed in to change notification settings - Fork 8.3k
INSERT into Map(Bool, DateTime) column fails on 25.10 #87601
Copy link
Copy link
Closed
Labels
potential bugTo be reviewed by developers and confirmed/rejected.To be reviewed by developers and confirmed/rejected.
Description
Company or project name
No response
Describe what's wrong
When inserting values into a column of type Map(Bool, DateTime), ClickHouse fails with
Error on processing query: Code: 349. DB::Exception: Cannot convert NULL value to non-Nullable type: while executing 'FUNCTION if(isNull(map(toBool(false), toDateTime(-dummy-0))) : 2, defaultValueOfTypeName('Map(Bool, DateTime)') :: 4, _CAST(map(toBool(false), toDateTime(-dummy-0)), 'Map(Bool, DateTime)') :: 5) -> if(isNull(map(toBool(false), toDateTime(-dummy-0))), defaultValueOfTypeName('Map(Bool, DateTime)'), ... Map(Bool, DateTime) : 3': While executing ValuesBlockInputFormat: data for INSERT was parsed from query. (CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN) (version 25.10.1.539 (official build))
Does it reproduce on the most recent release?
Yes
How to reproduce
CREATE TABLE table_27c510ba_998e_11f0_882c_e0c26496f172 (map_bool_datetime_ Map(Bool,DateTime))
ENGINE = MergeTree
ORDER BY tuple()SET send_logs_level = 'trace';
INSERT INTO table_27c510ba_998e_11f0_882c_e0c26496f172 VALUES (map(toBool(true),toDateTime('2106-02-07 06:28:15'))),(map(toBool(false),toDateTime('1970-01-01 00:00:00'))),(map(false,'1970-01-01 00:00:00')),(map(false,toDateTime(1662468258))),(map(false,toDateTime(1437903562))),(map(false,toDateTime(1357433696))),(map(false,toDateTime(1286632550))),(map(false,toDateTime(1095653045))),(map(false,toDateTime(1592793615))),(map(false,toDateTime(1651250455)));[clickhouse1] 2025.09.24 23:41:35.443425 [ 34 ] {c99e028e-63a2-4904-97a7-1bd3d9d2c69c} <Debug> executeQuery: (from 127.0.0.1:58456) (query 1, line 1) INSERT INTO table_27c510ba_998e_11f0_882c_e0c26496f172 VALUES (stage: Complete)
[clickhouse1] 2025.09.24 23:41:35.449131 [ 34 ] {c99e028e-63a2-4904-97a7-1bd3d9d2c69c} <Debug> TCPHandler: Processed in 0.006797838 sec.
[clickhouse1] 2025.09.24 23:41:35.449405 [ 34 ] {c99e028e-63a2-4904-97a7-1bd3d9d2c69c} <Information> executeQuery: Code: 735. DB::Exception: Received 'Cancel' packet from the client, canceling the query. (QUERY_WAS_CANCELLED_BY_CLIENT) (version 25.10.1.539 (official build)) (from 127.0.0.1:58456) (query 1, line 1) (in query: INSERT INTO table_27c510ba_998e_11f0_882c_e0c26496f172 VALUES )
Ok.
Error on processing query: Code: 349. DB::Exception: Cannot convert NULL value to non-Nullable type: while executing 'FUNCTION if(isNull(map(toBool(false), toDateTime(-dummy-0))) : 2, defaultValueOfTypeName('Map(Bool, DateTime)') :: 4, _CAST(map(toBool(false), toDateTime(-dummy-0)), 'Map(Bool, DateTime)') :: 5) -> if(isNull(map(toBool(false), toDateTime(-dummy-0))), defaultValueOfTypeName('Map(Bool, DateTime)'), ... Map(Bool, DateTime) : 3': While executing ValuesBlockInputFormat: data for INSERT was parsed from query. (CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN) (version 25.10.1.539 (official build))
Expected behavior
Successful insert
Error message and/or stacktrace
No response
Additional context
No response
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.