Skip to content

Unexpected return type from equals: Grouping sets and predicate pushdown #63349

@Algunenano

Description

@Algunenano

Report: https://s3.amazonaws.com/clickhouse-test-reports/0/009d08561d2312090193d3739fc7f60480703f41/stress_test__debug_.html

Repro:

CREATE TABLE test_grouping_sets_predicate (`day_` Date, `type_1` String) ENGINE = MergeTree ORDER BY day_;

INSERT INTO test_grouping_sets_predicate SELECT toDate('2023-01-05') AS day_, 'hello, world' FROM numbers (10);

SET group_by_use_nulls = true, allow_experimental_analyzer = false;

SELECT * FROM ( SELECT day_, if(type_1 = '', 'all', type_1) AS type_1 FROM ( SELECT day_, type_1 FROM test_grouping_sets_predicate GROUP BY GROUPING SETS ( (day_, type_1), (day_)) ) AS t ) WHERE day_ = '2023-01-05';
  • With the old analyzer: 2024.05.03 16:46:42.584778 [ 355222 ] {78d2f191-2030-4d8b-a252-5956029e9ebc} <Fatal> : Logical error: 'Unexpected return type from equals. Expected Nullable. Got UInt8'.

  • With the new analyzer: Code: 44. DB::Exception: Illegal column for DataTypeNullable. (ILLEGAL_COLUMN)

  • With new analyzer but setting group_by_use_nulls=false: Works fine

  • With new analyzer but removing the condition WHERE day_ = '2023-01-05': Works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    fuzzProblem found by one of the fuzzersnot plannedKnown issue, no plans to fix it currenlty

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions