apache / apache/datafusion-sqlparser-rs

Create test pattern for Spans

Abierto
#1,563 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
3.5k
Forks
772
Merge medio
4 d 9 h
PR fusionados (30 d)
17

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Lee el contexto de los issues 1548 y 1563, además de los PRs 1435 y 1549, para comprender la información de span existente y la cobertura de AST prevista. Empieza por el punto de entrada tests/sqlparser_spans.rs propuesto para las pruebas: analiza cadenas SQL representativas y compara los spans de los nodos del AST con las ubicaciones esperadas. Se considera terminado cuando el comportamiento de los spans está cubierto por pruebas y se pueden detectar regresiones.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
compilers, testing
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.