Skip to content

fix: Throw coercion error for LIKE operations for nested types.#20212

Open
jonathanc-n wants to merge 2 commits intoapache:mainfrom
jonathanc-n:like-fails
Open

fix: Throw coercion error for LIKE operations for nested types.#20212
jonathanc-n wants to merge 2 commits intoapache:mainfrom
jonathanc-n:like-fails

Conversation

@jonathanc-n
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Throw coercion error for LIKE adjacent operations. This matches DuckDB behaviour, just makes it clearer to users that nested types are not supported for this comparison.

Remove the list_coercion for LIKE comparisons

Are these changes tested?

SLT tests.

@github-actions github-actions bot added logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) labels Feb 7, 2026
INSERT INTO t0(v0, v2) VALUES (123, true);

query error There isn't a common type to coerce .* in .* expression
SELECT true FROM t0 WHERE ((REGEXP_MATCH(t0.v1, t0.v1)) NOT LIKE (REGEXP_MATCH(t0.v1, t0.v1, 'jH')));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these be easier to read by replacing the second regexp_match with just an array literal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good point, i made the changes for the others but kept this specific line:

SELECT true FROM t0 WHERE ((REGEXP_MATCH(t0.v1, t0.v1)) NOT LIKE (REGEXP_MATCH(t0.v1, t0.v1, 'jH')));

To just show replication of the query in the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LIKE fails on nested value

2 participants