-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use datafusion catalog directly + cleanup
- Loading branch information
1 parent
9a4c6f1
commit 97d3db0
Showing
6 changed files
with
129 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//! Simple tests that only check that the program doesn't panic. | ||
use std::error::Error; | ||
use std::fs; | ||
|
||
use optd_datafusion::run_queries; | ||
|
||
#[tokio::test] | ||
async fn test_scan() -> Result<(), Box<dyn Error>> { | ||
let file = fs::read_to_string("./sql/test_scan.sql")?; | ||
|
||
// Retrieve all of the SQL queries from the file. | ||
let queries: Vec<&str> = file | ||
.split(';') | ||
.filter(|query| !query.trim().is_empty()) | ||
.collect(); | ||
|
||
run_queries(&queries).await?; | ||
|
||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_filter() -> Result<(), Box<dyn Error>> { | ||
let file = fs::read_to_string("./sql/test_filter.sql")?; | ||
|
||
// Retrieve all of the SQL queries from the file. | ||
let queries: Vec<&str> = file | ||
.split(';') | ||
.filter(|query| !query.trim().is_empty()) | ||
.collect(); | ||
|
||
run_queries(&queries).await?; | ||
|
||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_join() -> Result<(), Box<dyn Error>> { | ||
let file = fs::read_to_string("./sql/test_join.sql")?; | ||
|
||
// Retrieve all of the SQL queries from the file. | ||
let queries: Vec<&str> = file | ||
.split(';') | ||
.filter(|query| !query.trim().is_empty()) | ||
.collect(); | ||
|
||
run_queries(&queries).await?; | ||
|
||
Ok(()) | ||
} |