Skip to content

INSERT into Map(Bool, DateTime) column fails on 25.10 #87601

@alsugiliazova

Description

@alsugiliazova

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    potential bugTo be reviewed by developers and confirmed/rejected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions