Skip to content

Commit

Permalink
feat(sqllogictest): add initial TPC-H Q1-6 tests (#232)
Browse files Browse the repository at this point in the history
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.

---------

Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh authored Nov 12, 2024
1 parent 7ac3930 commit b4061b1
Show file tree
Hide file tree
Showing 12 changed files with 683 additions and 3 deletions.
129 changes: 126 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"optd-gungnir",
"optd-perfbench",
"optd-datafusion-repr-adv-cost",
"optd-sqllogictest",
]
resolver = "2"

Expand Down
45 changes: 45 additions & 0 deletions optd-sqllogictest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[package]
name = "optd-sqllogictest"
description = "sqllogictest for optd"
version.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
thiserror = "2"
sqllogictest = "0.22"
clap = { version = "4.5.4", features = ["derive"] }
anyhow = { version = "1", features = ["backtrace"] }
async-trait = "0.1"
datafusion-optd-cli = { path = "../datafusion-optd-cli", version = "32.0.0" }
optd-datafusion-repr-adv-cost = { path = "../optd-datafusion-repr-adv-cost", version = "0.1" }
datafusion = { version = "32.0.0", features = [
"avro",
"crypto_expressions",
"encoding_expressions",
"regex_expressions",
"unicode_expressions",
"compression",
] }
env_logger = "0.9"
mimalloc = { version = "0.1", default-features = false }
regex = "1.8"
tokio = { version = "1.24", features = [
"macros",
"rt",
"rt-multi-thread",
"sync",
"parking_lot",
] }
optd-datafusion-bridge = { path = "../optd-datafusion-bridge", version = "0.1" }
optd-datafusion-repr = { path = "../optd-datafusion-repr", version = "0.1" }
itertools = "0.13"
lazy_static = "1.4.0"

[[test]]
name = "harness"
path = "./tests/harness.rs"
harness = false
Loading

0 comments on commit b4061b1

Please sign in to comment.