apache / apache/datafusion

Incorrect type coercion for IS SIMILAR TO

Aperta
#20,342 1 commento 1 reazione 1 assegnatario Rivendicata da @neilconway Vedi su GitHub
bug
Lingua principale
Rust
Stelle
9.3k
Fork
2.4k
Merge medio
3g 11h
PR unite (30g)
360

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.