Query error NOT_FOUND_COLUMN_IN_BLOCK · Issue #80703 · ClickHouse/ClickHouse · GitHub
Skip to content

Query error NOT_FOUND_COLUMN_IN_BLOCK #80703

Description

@pjain1

Company or project name

Rill Data

Describe what's wrong

Hello I am getting really weird query error NOT_FOUND_COLUMN_IN_BLOCK

SELECT
    arrayJoin(cust_flags) AS custs, 
    sum(__sourcerows) AS total_events
FROM sync_local
WHERE ((__timestamp >= '2025-05-15 02:00:00') AND (__timestamp < '2025-05-22 02:00:00')) AND (arrayJoin(cust_flags) IN ('<>')) AND (dictGetOrDefault('tags', 'site_name', p_id, '') IN ('<>'))
GROUP BY 1
ORDER BY 1 DESC
LIMIT 5000

Received exception from server (version 24.12.6):
Code: 10. DB::Exception: Received from :9440. DB::Exception: Not found column cust_flags in block: while executing 'INPUT : 1 -> cust_flags Array(String) : 5'. (NOT_FOUND_COLUMN_IN_BLOCK)

If I remove dictGetOrDefault condition from where clause then it works fine. Here is the create table -

CREATE TABLE default.sync_local
(
    `__partition` LowCardinality(String),
    `__sourcerows` UInt64,
    `__timestamp` DateTime,
    `p_id` LowCardinality(String),
    `cust_flags` Array(String),
    INDEX idx_set_p_id p_id TYPE set(100) GRANULARITY 1,
    INDEX idx_minmax_cust_flags cust_flags TYPE minmax GRANULARITY 2,
    PROJECTION sum_events__projection
    (
        SELECT __timestamp, p_id, sum(__sourcerows)
        GROUP BY 1, 2
    )
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')
PARTITION BY __partition
ORDER BY (__timestamp, p_id)
SETTINGS index_granularity = 8192

CH version - 24.12.6 version.

Does it reproduce on the most recent release?

Yes

How to reproduce

Have an array and dictionary and put them in where clause of a group by query

Expected behavior

No response

Error message and/or stacktrace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed user-visible misbehaviour in official release

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions