Skip to content

Hybrid: support Nullable null-map / IS NULL like MergeTree (remote segments) #2158

Description

@DimensionWieldr

Summary

Queries that work on local MergeTree (and typically on Distributed over MergeTree) fail on Hybrid when a segment is remote / icebergCluster, because Nullable null-map subcolumns (col.null) are not available in the remote block.

Generally my assumption is that what works for MergeTree should work on Hybrid.

Error

Code: 10. DB::Exception: Not found column long_col.null: in block ...

Reproduce

On a hybrid table with remote(MergeTree) + icebergCluster(...) (or similar object-storage segment), Nullable columns such as long_col Nullable(Int64) will cause SELECT to fail:

SELECT COUNT(*) FROM hybrid WHERE long_col IS NOT NULL;

SELECT COUNT(long_col), COUNT(double_col) FROM hybrid;

SELECT string_col,
       countIf(long_col IS NULL),
       countIf(long_col IS NOT NULL)
FROM hybrid
GROUP BY string_col;

Expected

Same semantics as querying the underlying MergeTree (or Distributed over MergeTree): IS [NOT] NULL, COUNT(nullable_col), countIf(... IS NULL), etc. should succeed and return correct results.


Workarounds used in tests:

Hybrid fuzz SQL currently avoids null-map shapes (e.g. col = col, ifNull, non-null aggregates) until this is supported.

Seen while enabling Hybrid query fuzzing in clickhouse-regression (iceberg/tests/hybrid/fuzzing) on Antalya 26.3.13.20001.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions