apache / apache/datafusion-sqlparser-rs
Increase testing & SQL support
- 主要語言
- Rust
- 星號
- 3.5k
- 分支
- 772
- 平均合併
- 4 天 9 小時
- 30 天內合併 PR
- 17
描述
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?
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
此 issue 是一項範圍廣泛的提案,涵蓋 SQL 語料庫、單元測試與基於屬性的測試、偵錯斷言以及模糊測試,但沒有指定具體的檔案或測試。首先檢視 parser 目前的測試進入點,以及 PR #211 中的模糊測試工作。要視為完成,必須將此提案縮小為一項具體的測試變更,並明確產生 parsing、serialization 或 fuzzing 結果。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- rust, sql
- 領域
- databases, testing-qa
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100