Skip to content

Commit

Permalink
fix: Test case, pretty print
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Oct 24, 2024
1 parent ae5dcb5 commit e7ef64e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions lykiadb-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tokio = { version = "~1.35.1", features = [
tokio-stream = { version = "~0.1.6", features = ["net"] }
tracing = "0.1"
tracing-subscriber = "0.3"
pretty_assertions = "1.4.1"

[dev-dependencies]
criterion = { version = "0.4", features = ["html_reports"] }
Expand Down
14 changes: 10 additions & 4 deletions lykiadb-server/tests/planner/join
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,21 @@ SELECT * FROM books b
#[name=three_way_reordered, run=plan]>

SELECT * FROM books b
INNER JOIN
(categories c ON b.category_id = c.id INNER JOIN publishers AS p ON b.publisher_id = p.id)
INNER JOIN
(
categories c
INNER JOIN
publishers AS p
ON b.category_id = c.id
)
ON b.publisher_id = p.id
WHERE p.name = 'Springer';

---

- filter (p.name IsEqual Str("Springer")):
- join [Inner, (b.publisher_id IsEqual p.id)]:
- scan [books as b]
- join [Inner, (b.category_id IsEqual c.id)]:
- scan [categories as c]
- scan [publishers as p]
- scan [books as b]
- scan [publishers as p]
1 change: 1 addition & 0 deletions lykiadb-server/tests/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use lykiadb_lang::{ast::stmt::Stmt, parser::program::Program};
use lykiadb_server::plan::planner::Planner;
use pretty_assertions::assert_eq;

fn expect_plan(query: &str, expected_plan: &str) {
let mut planner = Planner::new();
Expand Down

0 comments on commit e7ef64e

Please sign in to comment.