cmu-db / optd

CMU-DB's Cascades optimizer framework
https://cmu-db.github.io/optd/
MIT License
383 stars 22 forks source link

feat(sqllogictest): add initial TPC-H Q1-6 tests #232

Closed skyzh closed 2 weeks ago

skyzh commented 2 weeks ago

We don't really know if the generated plan is correct or not -- what we all know now is whether we can generate a plan. Therefore, it's important to also evaluate if the result is correct. In this patch, we add sqllogictest, the test infra to ensure the execution result is correct.

In sqllogictest.rs, you can replace the following statement to planning + execution solely with datafusion. This yields source-of-truth result.

DatafusionDBMS::new_no_optd().await?

Now we have TPC-H Q1-6. Note that Q2 doesn't work b/c there are too many NLJs and the datafusion built-in statistics would throw multiply overflow error.