octet_length(char) doesn't behave as expected.
- Lingua principale
- Rust
- Stelle
- 9.3k
- Fork
- 2.4k
- Merge medio
- 3g 11h
- PR unite (30g)
- 360
Descrizione
### Describe the bug
Hi there,
``select octet_length(char)`` doesn't behave as expected.
In the example below - in Postgres (``text`` column) the below SQL would return 25 as the result however in DataFusion (``StringArray`` column ) it just returns the original length of the values in ``n_name``.
```sql
select octet_length(n_name::char(25)) from nation;
```
I'm not sure if this is because the cast to a ``char(25)`` is not behaving as expected
### To Reproduce
create a StringColumn in DF, populate it with some values and run the following SQL on it.
```sql
select octet_length(n_name::char(25)) from nation;
```
### Expected behavior
Should return 25, but it returns the length of each of the values in the column.
### Additional context
_No response_
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con la riproduzione SQL usando un DataFusion StringArray e confronta octet_length(n_name::char(25)) con il risultato di PostgreSQL. Traccia il cast a char(25) e il comportamento di octet_length; quindi aggiungi una copertura che mostri che l’espressione restituisce 25 per i valori riprodotti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql, rust, sql
- Ambito
- databases
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100