From d9ccaf011f714b5f8dc669afb2e606d5b7639de0 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 7 Oct 2022 17:07:55 -0400 Subject: [PATCH 1/4] Run more examples in CI --- .github/workflows/rust.yml | 18 +++++++++++++++--- .../examples/parquet_sql_multiple_files.rs | 6 +++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 937fad7f5220..77bfc14957df 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -98,16 +98,28 @@ jobs: with: rust-version: stable - name: Run tests + run: | + export PATH=$PATH:$HOME/d/protoc/bin + cargo test --features avro,jit,scheduler,json + - name: Run examples run: | export PATH=$PATH:$HOME/d/protoc/bin cargo test --features avro,jit,scheduler,json # test datafusion-sql examples cargo run --example sql - # test datafusion examples - cd datafusion-examples + # test datafusion-examples + cargo run --example avro_sql --features=datafusion/avro cargo run --example csv_sql + cargo run --example custom_datasource + cargo run --example dataframe + cargo run --example dataframe_in_memory + cargo run --example deserialize_to_struct cargo run --example parquet_sql - cargo run --example avro_sql --features=datafusion/avro + cargo run --example parquet_sql_multiple_files + cargo run --example memtable + cargo run --example simple_udf + cargo run --example simple_udaf + integration-test: name: "Compare to postgres" diff --git a/datafusion-examples/examples/parquet_sql_multiple_files.rs b/datafusion-examples/examples/parquet_sql_multiple_files.rs index 2b7a5f6fe268..5e8bcb2dc4e2 100644 --- a/datafusion-examples/examples/parquet_sql_multiple_files.rs +++ b/datafusion-examples/examples/parquet_sql_multiple_files.rs @@ -57,9 +57,9 @@ async fn main() -> Result<()> { // execute the query let df = ctx .sql( - "SELECT int_col, double_col, CAST(date_string_col as VARCHAR) \ - FROM alltypes_plain \ - WHERE id > 1 AND tinyint_col < double_col", + "SELECT * \ + FROM my_table \ + LIMIT 1" ) .await?; From a1595a2d42da884740c21a403822d81a5c6bbaa7 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 11 Oct 2022 06:21:20 -0400 Subject: [PATCH 2/4] fix compilation --- datafusion-examples/examples/parquet_sql_multiple_files.rs | 2 +- datafusion/core/src/dataframe.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/datafusion-examples/examples/parquet_sql_multiple_files.rs b/datafusion-examples/examples/parquet_sql_multiple_files.rs index 5e8bcb2dc4e2..edbcea61ea1d 100644 --- a/datafusion-examples/examples/parquet_sql_multiple_files.rs +++ b/datafusion-examples/examples/parquet_sql_multiple_files.rs @@ -59,7 +59,7 @@ async fn main() -> Result<()> { .sql( "SELECT * \ FROM my_table \ - LIMIT 1" + LIMIT 1", ) .await?; diff --git a/datafusion/core/src/dataframe.rs b/datafusion/core/src/dataframe.rs index 06768b5631ca..240aed0739c7 100644 --- a/datafusion/core/src/dataframe.rs +++ b/datafusion/core/src/dataframe.rs @@ -827,9 +827,6 @@ impl TableProvider for DataFrame { #[cfg(test)] mod tests { - use arrow::array::Int32Array; - use std::vec; - use super::*; use crate::execution::options::CsvReadOptions; use crate::physical_plan::ColumnarValue; @@ -841,6 +838,7 @@ mod tests { avg, cast, count, count_distinct, create_udf, lit, max, min, sum, BuiltInWindowFunction, ScalarFunctionImplementation, Volatility, WindowFunction, }; + use std::vec; #[tokio::test] async fn select_columns() -> Result<()> { From 3226b5dcd9cf4155adeff1274fd524657c6b4915 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 11 Oct 2022 13:46:23 -0400 Subject: [PATCH 3/4] Do not run tests twice --- .github/workflows/rust.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 77bfc14957df..da517de6012f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -104,7 +104,6 @@ jobs: - name: Run examples run: | export PATH=$PATH:$HOME/d/protoc/bin - cargo test --features avro,jit,scheduler,json # test datafusion-sql examples cargo run --example sql # test datafusion-examples From bef7ccb7e211854fe2e830aec4e58dc42d918f76 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 12 Oct 2022 13:35:08 -0400 Subject: [PATCH 4/4] Add expr_api to example --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8386ef0cfeeb..31014fd30659 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -116,6 +116,7 @@ jobs: cargo run --example dataframe cargo run --example dataframe_in_memory cargo run --example deserialize_to_struct + cargo run --example expr_api cargo run --example parquet_sql cargo run --example parquet_sql_multiple_files cargo run --example memtable