apache / apache/datafusion-sqlparser-rs
Increase testing & SQL support
- Langage dominant
- Rust
- Étoiles
- 3.5k
- Forks
- 772
- Merge moyen
- 4 j 9 h
- PR mergées (30 j)
- 17
Description
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?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Cette issue est une proposition générale couvrant les corpus SQL, les tests unitaires et property-based, les assertions de débogage et le fuzzing, sans nommer de fichier ni de test précis. Commencez par examiner les points d’entrée actuels des tests du parser et le travail de fuzzing dans PR #211. Pour que le travail soit considéré comme terminé, il faut réduire la proposition à une modification concrète des tests avec un résultat explicite de parsing, de sérialisation ou de fuzzing.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust, sql
- Domaine
- databases, testing-qa
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100