Skip to content

Prohibited LowCardinality when importing tables with dates #87586

@pkese

Description

@pkese

Company or project name

oecd.ai

Describe what's wrong

Since version 25.8 I'm suddenly getting:
DB::Exception: Creating columns of type LowCardinality(Date) is prohibited by default due to expected negative impact on performance. It can be enabled with the allow_suspicious_low_cardinality_types setting. (SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY)

Does it reproduce on the most recent release?

Yes

How to reproduce

ClickHouse client version 25.8.4.13 (official build).

This works fine

CREATE TABLE pq_test1 ENGINE = MergeTree ORDER BY (year, src, dst)
SETTINGS allow_nullable_key = 1
AS SELECT * FROM url('https://storage.googleapis.com/cliclhouse-bug-repro-42/pq_test.parquet', Parquet)

This fails (notice there's additional date hp=2025-09-24 in provided url path, the rest is the same)

CREATE TABLE pq_test2 ENGINE = MergeTree ORDER BY (year, src, dst)
SETTINGS allow_nullable_key = 1
AS SELECT * FROM url('https://storage.googleapis.com/cliclhouse-bug-repro-42/hp=2025-09-24/pq_test.parquet', Parquet)
Received exception from server (version 25.8.4):
Code: 455. DB::Exception: Received from localhost:9000. DB::Exception: Creating columns of type LowCardinality(Date) is prohibited by default due to expected negative impact on performance. It can be enabled with the `allow_suspicious_low_cardinality_types` setting. (SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY)

The interesting thing is that there isn't any column of type Date in that table itself ... but Clickhouse somehow infers the hp=2025-09-24 from the url and treats it as a table row.

DESCRIBE TABLE url('https://storage.googleapis.com/cliclhouse-bug-repro-42/hp=2025-09-24/pq_test.parquet', Parquet)

Query id: ad710a68-ad47-408f-8628-ba06db8194b3

   ┌─name─────────┬─type─────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
1. │ year         │ Nullable(Int64)      │              │                    │         │                  │                │
2. │ src          │ Nullable(String)     │              │                    │         │                  │                │
3. │ dst          │ Nullable(String)     │              │                    │         │                  │                │
4. │ Deals        │ Nullable(Int64)      │              │                    │         │                  │                │
5. │ Sum_of_deals │ Nullable(Float64)    │              │                    │         │                  │                │
6. │ hp           │ LowCardinality(Date) │              │                    │         │                  │                │
   └──────────────┴──────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

6 rows in set. Elapsed: 0.072 sec. 

Expected behavior

No response

Error message and/or stacktrace

No response

Additional context

I assume that the real problem may be that ClickHouse is parsing the hp=2025-09-24 as some extra Hive metadata and is trying to implicitly add that as a hidden column to the table being created.

However the reported error message is not mentioning any Hive thing and is generally not helpful in this situation.

Metadata

Metadata

Assignees

No one assigned

    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