apache / apache/datafusion-sqlparser-rs
Parse negative numbers for Postgres Dialect
- Linguagem predominante
- Rust
- Estrelas
- 3.5k
- Forks
- 772
- Merge médio
- 4d 9h
- PRs com merge (30d)
- 17
Descrição
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')}}},)}
```
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- postgresql, rust
- Domínio
- databases
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100