Arithmetic on a SYMBOL column uses its dictionary key instead of its value
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
Direzione di ricerca
Start by tracing how QuestDB evaluates arithmetic expressions on SYMBOL columns, then compare that path with the value conversion used by sy::INT. Reproduce with the SQL in the issue and inspect nearby tests for SYMBOL arithmetic. Done when arithmetic uses the symbol value or rejects the operation with an error, including the listed cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Arithmetic on a SYMBOL column, such as sy + 0, computes with the symbol's dictionary key rather than its value, so it returns numbers unrelated to the data. A cast, sy::INT, converts the value as expected. No error is raised.
Repro
CREATE TABLE x (sy SYMBOL, id INT, k TIMESTAMP) TIMESTAMP(k);
INSERT INTO x VALUES
('1', 1, 0), ('2', 2, 1), ('3', 3, 2), ('-1', 4, 3),
('5000000001', 5, 4), (null, 6, 5), ('1', 7, 6);
SELECT sy, sy + 0 AS plus0, sy * 1 AS times1, sy::INT AS asint FROM x;
| sy | sy + 0 | sy * 1 | sy::INT |
|---|---|---|---|
| 1 | 0 | 0 | 1 |
| 2 | 1 | 1 | 2 |
| 3 | 2 | 2 | 3 |
| -1 | 3 | 3 | -1 |
| 5000000001 | 4 | 4 | null |
| null | null | null | null |
| 1 | 0 | 0 | 1 |
SELECT 'a'::SYMBOL + 0 returns 0. A filter such as WHERE 1 + 1 = sy + 0 therefore matches the row holding '3'.
Either cast the value, as sy::INT does, or reject arithmetic on SYMBOL with an error.
- Lingua principale
- Java
- Stelle
- 17.5k
- Fork
- 1.7k
- Merge medio
- 5g 11h
- PR unite (30g)
- 64
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di questdb/questdb
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
A CHAR cast to LONG256 fails with an error that names LONGForse già presa @sgavriil01 l’ha presa oggi. ApertaBug SQL
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
questdb/questdb#8352 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
ILP over UDP stores lines without a timestamp in 1970 on tables with a nanosecond designated timestampForse già presa @pcbeingused333 l’ha presa 2 giorni fa. ApertaBug ILP
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
questdb/questdb#8322 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
COPY into a table with a DATE or TIMESTAMP column fails when the CSV file does not have that columnApertaBug SQL
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di questdb/questdb
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dekobon/big-code-analysis#1913 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug:unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
UniversalMediaServer/UniversalMediaServer#6473 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ClickHouse/clickhouse-java#3349 ·
I maintainer di solito rispondono entro 1 giorno