You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2021/11/02 10:50:28 UTC

[arrow-datafusion] branch master updated: Fix build with `--no-default-features` (#1219)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 91b5469  Fix build with `--no-default-features` (#1219)
91b5469 is described below

commit 91b5469c2061329c4d20f6dcfbaa44a6a255d86b
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Tue Nov 2 06:49:55 2021 -0400

    Fix build with `--no-default-features` (#1219)
    
    * Check build works without default features
    
    * Fix lazy static use
---
 .github/workflows/rust.yml                        | 6 ++++++
 datafusion/Cargo.toml                             | 4 ++--
 datafusion/src/lib.rs                             | 4 ----
 datafusion/src/physical_plan/file_format/mod.rs   | 1 +
 datafusion/src/physical_plan/regex_expressions.rs | 1 +
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 0fd42a6..b475775 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -64,6 +64,12 @@ jobs:
         env:
           CARGO_HOME: "/github/home/.cargo"
           CARGO_TARGET_DIR: "/github/home/target"
+      - name: Check DataFusion Build without default features
+        run: |
+          cargo check --no-default-features -p datafusion
+        env:
+          CARGO_HOME: "/github/home/.cargo"
+          CARGO_TARGET_DIR: "/github/home/target"
 
   # test the crate
   linux-test:
diff --git a/datafusion/Cargo.toml b/datafusion/Cargo.toml
index e05bc07..793262a 100644
--- a/datafusion/Cargo.toml
+++ b/datafusion/Cargo.toml
@@ -41,7 +41,7 @@ path = "src/lib.rs"
 default = ["crypto_expressions", "regex_expressions", "unicode_expressions"]
 simd = ["arrow/simd"]
 crypto_expressions = ["md-5", "sha2", "blake2", "blake3"]
-regex_expressions = ["regex", "lazy_static"]
+regex_expressions = ["regex"]
 unicode_expressions = ["unicode-segmentation"]
 # Used for testing ONLY: causes all values to hash to the same value (test for collisions)
 force_hash_collisions = []
@@ -70,7 +70,7 @@ blake3 = { version = "1.0", optional = true }
 ordered-float = "2.0"
 unicode-segmentation = { version = "^1.7.1", optional = true }
 regex = { version = "^1.4.3", optional = true }
-lazy_static = { version = "^1.4.0", optional = true }
+lazy_static = { version = "^1.4.0" }
 smallvec = { version = "1.6", features = ["union"] }
 rand = "0.8"
 avro-rs = { version = "0.13", features = ["snappy"], optional = true }
diff --git a/datafusion/src/lib.rs b/datafusion/src/lib.rs
index fa140ce..2159864 100644
--- a/datafusion/src/lib.rs
+++ b/datafusion/src/lib.rs
@@ -236,9 +236,5 @@ pub(crate) mod field_util;
 pub mod test;
 pub mod test_util;
 
-#[macro_use]
-#[cfg(feature = "regex_expressions")]
-extern crate lazy_static;
-
 #[cfg(doctest)]
 doc_comment::doctest!("../../README.md", readme_example_test);
diff --git a/datafusion/src/physical_plan/file_format/mod.rs b/datafusion/src/physical_plan/file_format/mod.rs
index d460e98..3ad8ffe 100644
--- a/datafusion/src/physical_plan/file_format/mod.rs
+++ b/datafusion/src/physical_plan/file_format/mod.rs
@@ -39,6 +39,7 @@ use crate::{
     datasource::{object_store::ObjectStore, PartitionedFile},
     scalar::ScalarValue,
 };
+use lazy_static::lazy_static;
 use std::{
     collections::HashMap,
     fmt::{Display, Formatter, Result as FmtResult},
diff --git a/datafusion/src/physical_plan/regex_expressions.rs b/datafusion/src/physical_plan/regex_expressions.rs
index 4a10d0d..e4d1f2e 100644
--- a/datafusion/src/physical_plan/regex_expressions.rs
+++ b/datafusion/src/physical_plan/regex_expressions.rs
@@ -28,6 +28,7 @@ use crate::error::{DataFusionError, Result};
 use arrow::array::{ArrayRef, GenericStringArray, StringOffsetSizeTrait};
 use arrow::compute;
 use hashbrown::HashMap;
+use lazy_static::lazy_static;
 use regex::Regex;
 
 macro_rules! downcast_string_arg {