apache / apache/datafusion-sqlparser-rs
Create test pattern for Spans
- Lingua principale
- Rust
- Stelle
- 3.5k
- Fork
- 772
- Merge medio
- 4g 9h
- PR unite (30g)
- 17
Descrizione
Part of https://github.com/apache/datafusion-sqlparser-rs/issues/1548
# Usecase
- We have added span information in https://github.com/apache/datafusion-sqlparser-rs/pull/1435
We would like to add span information through out the rest of the AST structures (see docs in https://github.com/apache/datafusion-sqlparser-rs/pull/1549) and list on https://github.com/apache/datafusion-sqlparser-rs/issues/1548
In order to support this feature reasonably, we need to be able to test the feature and avoid regressions
# Proposal
I think we need some sort of span test.
I recommend
1. A new test binary like `tests/sqlparser_spans.rs`
Then add a test that
1. Parses a SQL string
2. Check the spans of the AST nodes match what is expected
I think we'll have to use judgement on how fine grained the location information
can / should be.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Leggi il contesto delle issues 1548 e 1563, oltre ai PR 1435 e 1549, per comprendere le informazioni sugli span esistenti e la copertura AST pianificata. Inizia dal punto di ingresso proposto per i test, tests/sqlparser_spans.rs: analizza stringhe SQL rappresentative e confronta gli span dei nodi AST con le posizioni previste. Il lavoro è completo quando il comportamento degli span è coperto dai test ed è possibile rilevare le regressioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- compilers, testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100