Skip to content

Incorrect type coercion for IS SIMILAR TO #20342

@neilconway

Description

@neilconway

Describe the bug

-- works
  SELECT CAST('hello' AS BYTEA) LIKE 'hello%';

-- fails ("Cannot infer common argument type for regex operation Binary ~ Utf8")
  SELECT CAST('hello' AS BYTEA) SIMILAR TO 'hello%';

-- works
  SELECT arrow_cast('hello', 'Dictionary(Int32, Utf8)') LIKE 'hello%';

-- fails ("Data type Dictionary(Int32, Utf8) not supported for regex_match_dyn")
  SELECT arrow_cast('hello', 'Dictionary(Int32, Utf8)') SIMILAR TO 'hello%';

I believe we'd want the same behavior for LIKE and IS SIMILAR TO. Per discussion in #20306

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions