apache / apache/datafusion-sqlparser-rs

Parse negative numbers for Postgres Dialect

Aperta
#549 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
3.5k
Fork
772
Merge medio
4g 9h
PR unite (30g)
17

Descrizione

Parser should parse negative numbers as is, rather than into a unary_op neg, wrapping an inner value, to be consistent with Postgres.

Postgres behaviour using (pglast):
```
[nix-shell:~/projects/risingwave-nix]$ ./query_parser.py "select -(-(-(9223372036854775808)))"
{'@': 'SelectStmt',
'all': False,
'limitOption': {'#': 'LimitOption',
'name': 'LIMIT_OPTION_DEFAULT',
'value': 0},
'op': {'#': 'SetOperation', 'name': 'SETOP_NONE', 'value': 0},
'targetList': ({'@': 'ResTarget',
'location': 7,
'val': {'@': 'A_Const',
'location': 7,
'val': {'@': 'Float',
'val': Decimal('-9223372036854775808')}}},)}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Reproduce the nested-negative example through the Postgres dialect, using the query_parser.py entry point shown in the issue. Trace how negative numeric literals are represented in the parser output; done means they match the shown Postgres behavior as numeric constants rather than unary_op nodes, with relevant parser coverage added or updated once located.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
postgresql, rust
Ambito
databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.