Skip to content

Commit

Permalink
Test optional features in CI (#2708)
Browse files Browse the repository at this point in the history
* Test optional features in CI

Fix parquet SQL benchmarks

* Fix further failures

* Fix doctest
  • Loading branch information
tustvold authored Jun 7, 2022
1 parent 1db7f00 commit a6e93a1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"
- name: Check Workspace builds with all features
run: |
cargo check --workspace --benches --features avro,jit,scheduler
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"

# test the crate
linux-test:
Expand Down Expand Up @@ -115,7 +121,7 @@ jobs:
run: |
export ARROW_TEST_DATA=$(pwd)/testing/data
export PARQUET_TEST_DATA=$(pwd)/parquet-testing/data
cargo test --features avro
cargo test --features avro,jit,scheduler
# test datafusion-sql examples
cargo run --example sql
# test datafusion examples
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ default = ["crypto_expressions", "regex_expressions", "unicode_expressions"]
# Used for testing ONLY: causes all values to hash to the same value (test for collisions)
force_hash_collisions = []
# Used to enable JIT code generation
jit = ["datafusion-jit"]
jit = ["datafusion-jit", "datafusion-row/jit"]
pyarrow = ["pyo3", "arrow/pyarrow", "datafusion-common/pyarrow"]
regex_expressions = ["datafusion-physical-expr/regex_expressions"]
# Used to enable scheduler
Expand Down
7 changes: 4 additions & 3 deletions datafusion/core/benches/parquet_query_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ where

fn generate_file() -> NamedTempFile {
let now = Instant::now();
let named_file = tempfile::Builder::new()
let mut named_file = tempfile::Builder::new()
.prefix("parquet_query_sql")
.suffix(".parquet")
.tempfile()
Expand Down Expand Up @@ -260,8 +260,9 @@ fn criterion_benchmark(c: &mut Criterion) {
local_rt.block_on(async {
let query = context.sql(&query).await.unwrap();
let plan = query.create_physical_plan().await.unwrap();
let mut stream =
scheduler.schedule(plan, context.task_ctx()).unwrap();
let results = scheduler.schedule(plan, context.task_ctx()).unwrap();

let mut stream = results.stream();
while stream.next().await.transpose().unwrap().is_some() {}
});
});
Expand Down
6 changes: 3 additions & 3 deletions datafusion/core/src/scheduler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//! ```rust
//! # use futures::TryStreamExt;
//! # use datafusion::prelude::{CsvReadOptions, SessionConfig, SessionContext};
//! # use datafusion_scheduler::Scheduler;
//! # use datafusion::scheduler::Scheduler;
//!
//! # #[tokio::main]
//! # async fn main() {
Expand All @@ -68,8 +68,8 @@
//! .unwrap();
//!
//! let task = context.task_ctx();
//! let stream = scheduler.schedule(plan, task).unwrap();
//! let scheduled: Vec<_> = stream.try_collect().await.unwrap();
//! let results = scheduler.schedule(plan, task).unwrap();
//! let scheduled: Vec<_> = results.stream().try_collect().await.unwrap();
//! # }
//! ```
//!
Expand Down

0 comments on commit a6e93a1

Please sign in to comment.