apache / apache/datafusion-sqlparser-rs

Increase testing & SQL support

未关闭
#212 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。