Skip to content

LIKE fails on nested value #20210

@neilconway

Description

@neilconway

Describe the bug

datafusion_physical_expr_common::datum::apply_cmp does not handle LikeMatch, ILikeMatch, etc for nested data types.

To Reproduce

CREATE TABLE t0(v0 BIGINT, v1 STRING, v2 BOOLEAN);
INSERT INTO t0(v0, v2) VALUES (123, true);
SELECT true FROM t0 WHERE ((REGEXP_MATCH(t0.v1, t0.v1)) NOT LIKE (REGEXP_MATCH(t0.v1, t0.v1, 'jH')));

Yields

Internal error: Assertion failed: matches!(op, Operator::Eq | Operator::NotEq | Operator::Lt | Operator::Gt |
Operator::LtEq | Operator::GtEq | Operator::IsDistinctFrom |
Operator::IsNotDistinctFrom) &&
left_data_type.equals_datatype(&right_data_type): invalid operator or data type mismatch for nested data, op !~~ left List(Utf8View), right List(Utf8View).
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions