apache / apache/datafusion-sqlparser-rs
Increase testing & SQL support
- Vorherrschende Sprache
- Rust
- Sterne
- 3.5k
- Forks
- 772
- Ø Merge
- 4 T. 9 Std.
- Gemergte PRs (30 T.)
- 17
Beschreibung
I want to write down some ideas about increasing support for commonly used SQL statement.
Some different ideas for doing more testing:
1. Add SQL corpora that should be parsed correctly. I think we can create a directory with multiple dialects with multiple corpora.
Examples can be TPCDS benchmark http://www.tpc.org/tpcds/ and other resources from different projects.
We can test two main things here:
- Whether everything parses to a statement
- When serialized (e.g. to JSON), whether it outputs the same thing as a earlier version of slqparser.
2. Increasing test coverage by adding unit tests
3. Increasing test coverage (not only when measuring coverage by line) by adding property-based tests https://github.com/BurntSushi/quickcheck https://github.com/AltSysrq/proptest
3. Add debug asserts, to make sure any assumptions about the inputs are correct. Because those are enabled during testing, they can be very helpful in general to make sure those really hold.
4. Fuzzing https://github.com/andygrove/sqlparser-rs/pull/211 . This can help with finding any edge cases in the parser which crashes without much effort.
Some great list of general testing strategies can be found here:
https://www.sqlite.org/testing.html
Any feedback, ideas on this?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Dieses Issue ist ein breit gefasster Vorschlag, der SQL-Korpora, Unit- und Property-based-Tests, Debug-Assertions und Fuzzing abdeckt, ohne eine bestimmte Datei oder einen bestimmten Test zu nennen. Beginne damit, die aktuellen Test-Einstiegspunkte des Parsers und die Fuzzing-Arbeiten in PR #211 zu überprüfen. Für den Abschluss muss der Vorschlag auf eine konkrete Teständerung mit einem expliziten Parsing-, Serialisierungs- oder Fuzzing-Ergebnis eingegrenzt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, sql
- Bereich
- databases, testing-qa
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100