Apache DataFusion SQL Query Engine
Add CI compile checks for feature flags in datafusion-functions (#9772)
Andrew Lambd896000ad311
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.ymlindex 07c46351e9..ffd45b9777 100644--- a/.github/workflows/rust.yml+++ b/.github/workflows/rust.yml@@ -65,42 +65,73 @@ jobs:# this key equals the ones on `linux-build-lib` for re-usekey: cargo-cache-benchmark-${{ hashFiles('datafusion/**/Cargo.toml', 'benchmarks/Cargo.toml', 'datafusion-cli/Cargo.toml') }}- - name: Check workspace without default features+ - name: Check datafusion without default features+ # Some of the test binaries require the parquet feature still+ #run: cargo check --all-targets --no-default-features -p datafusionrun: cargo check --no-default-features -p datafusion- name: Check datafusion-common without default features- run: cargo check --tests --no-default-features -p datafusion-common+ run: cargo check --all-targets --no-default-features -p datafusion-common++ - name: Check datafusion-functions+ run: cargo check --all-targets --no-default-features -p datafusion-functions- name: Check workspace in debug moderun: cargo check- - name: Check workspace with all features+ - name: Check workspace with avro,json featuresrun: cargo check --workspace --benches --features avro,json+ - name: Check Cargo.lock for datafusion-cli+ run: |+ # If this test fails, try running `cargo update` in the `datafusion-cli` directory+ # and check in the updated Cargo.lock file.+ cargo check --manifest-path datafusion-cli/Cargo.toml --locked+# Ensure that the datafusion crate can be built with only a subset of the function# packages enabled.- - name: Check function packages (array_expressions)+ - name: Check datafusion (array_expressions)run: cargo check --no-default-features --features=array_expressions -p datafusion- - name: Check function packages (datetime_expressions)+ - name: Check datafusion (crypto)+ run: cargo check --no-default-features --features=crypto_expressions -p datafusion++ - name: Check datafusion (datetime_expressions)run: cargo check --no-default-features --features=datetime_expressions -p datafusion- - name: Check function packages (encoding_expressions)+ - name: Check datafusion (encoding_expressions)run: cargo check --no-default-features --features=encoding_expressions -p datafusion- - name: Check function packages (math_expressions)+ - name: Check datafusion (math_expressions)run: cargo check --no-default-features --features=math_expressions -p datafusion- - name: Check function packages (regex_expressions)+ - name: Check datafusion (regex_expressions)run: cargo check --no-default-features --features=regex_expressions -p datafusion- - name: Check Cargo.lock for datafusion-cli- run: |- # If this test fails, try running `cargo update` in the `datafusion-cli` directory- # and check in the updated Cargo.lock file.- cargo check --manifest-path datafusion-cli/Cargo.toml --locked+ - name: Check datafusion (string_expressions)+ run: cargo check --no-default-features --features=string_expressions -p datafusion++ # Ensure that the datafusion-functions crate can be built with only a subset of the function+ # packages enabled.+ - name: Check datafusion-functions (crypto)+ run: cargo check --all-targets --no-default-features --features=crypto_expressions -p datafusion-functions++ - name: Check datafusion-functions (datetime_expressions)+ run: cargo check --all-targets --no-default-features --features=datetime_expressions -p datafusion-functions++ - name: Check datafusion-functions (encoding_expressions)+ run: cargo check --all-targets --no-default-features --features=encoding_expressions -p datafusion-functions++ - name: Check datafusion-functions (math_expressions)+ run: cargo check --all-targets --no-default-features --features=math_expressions -p datafusion-functions++ - name: Check datafusion-functions (regex_expressions)+ run: cargo check --all-targets --no-default-features --features=regex_expressions -p datafusion-functions++ - name: Check datafusion-functions (string_expressions)+ run: cargo check --all-targets --no-default-features --features=string_expressions -p datafusion-functions- # test the crate+ # Run testslinux-test:name: cargo test (amd64)needs: [ linux-build-lib ]diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.tomlindex fbbe047880..18946334db 100644--- a/datafusion/core/Cargo.toml+++ b/datafusion/core/Cargo.toml@@ -50,6 +50,7 @@ default = ["datetime_expressions","encoding_expressions","regex_expressions",+ "string_expressions","unicode_expressions","compression","parquet",@@ -66,6 +67,7 @@ regex_expressions = ["datafusion-functions/regex_expressions",]serde = ["arrow-schema/serde"]+string_expressions = ["datafusion-functions/string_expressions"]unicode_expressions = ["datafusion-physical-expr/unicode_expressions","datafusion-optimizer/unicode_expressions",@@ -188,6 +190,7 @@ name = "physical_plan"[[bench]]harness = falsename = "parquet_query_sql"+required-features = ["parquet"][[bench]]harness = false@@ -204,7 +207,3 @@ name = "sort"[[bench]]harness = falsename = "topk_aggregate"--[[bench]]-harness = false-name = "array_expression"diff --git a/datafusion/functions-array/Cargo.toml b/datafusion/functions-array/Cargo.tomlindex 80c0e5e187..6ef9c6b055 100644--- a/datafusion/functions-array/Cargo.toml+++ b/datafusion/functions-array/Cargo.toml@@ -49,3 +49,10 @@ datafusion-functions = { workspace = true }itertools = { version = "0.12", features = ["use_std"] }log = { workspace = true }paste = "1.0.14"++[dev-dependencies]+criterion = { version = "0.5", features = ["async_tokio"] }++[[bench]]+harness = false+name = "array_expression"diff --git a/datafusion/core/benches/array_expression.rs b/datafusion/functions-array/benches/array_expression.rssimilarity index 93%rename from datafusion/core/benches/array_expression.rsrename to datafusion/functions-array/benches/array_expression.rsindex c980329620..48b829793c 100644--- a/datafusion/core/benches/array_expression.rs+++ b/datafusion/functions-array/benches/array_expression.rs@@ -18,12 +18,10 @@#[macro_use]extern crate criterion;extern crate arrow;-extern crate datafusion;-mod data_utils;use crate::criterion::Criterion;-use datafusion::functions_array::expr_fn::{array_replace_all, make_array};use datafusion_expr::lit;+use datafusion_functions_array::expr_fn::{array_replace_all, make_array};fn criterion_benchmark(c: &mut Criterion) {// Construct large arrays for benchmarkingdiff --git a/datafusion/functions/Cargo.toml b/datafusion/functions/Cargo.tomlindex 3ae3061012..51452b9d4c 100644--- a/datafusion/functions/Cargo.toml+++ b/datafusion/functions/Cargo.toml@@ -90,15 +90,19 @@ tokio = { workspace = true, features = ["macros", "rt", "sync"] }[[bench]]harness = falsename = "to_timestamp"+required-features = ["datetime_expressions"][[bench]]harness = falsename = "regx"+required-features = ["regex_expressions"][[bench]]harness = falsename = "make_date"+required-features = ["datetime_expressions"][[bench]]harness = falsename = "to_char"+required-features = ["datetime_expressions"]