Skip to content

Apache DataFusion SQL Query Engine

Add necessary features to optimizer (#5540)

Liang-Chi Hsiehf4f4d708cef4
diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml
index f55eb3986b..a17028723d 100644
--- a/datafusion/core/Cargo.toml
+++ b/datafusion/core/Cargo.toml
@@ -41,21 +41,21 @@ path = "src/lib.rs"
# Used to enable the avro format
avro = ["apache-avro", "num-traits", "datafusion-common/avro"]
compression = ["xz2", "bzip2", "flate2", "zstd", "async-compression"]
-crypto_expressions = ["datafusion-physical-expr/crypto_expressions"]
+crypto_expressions = ["datafusion-physical-expr/crypto_expressions", "datafusion-optimizer/crypto_expressions"]
default = ["crypto_expressions", "regex_expressions", "unicode_expressions", "compression"]
# Enables support for non-scalar, binary operations on dictionaries
# Note: this results in significant additional codegen
-dictionary_expressions = ["datafusion-physical-expr/dictionary_expressions"]
+dictionary_expressions = ["datafusion-physical-expr/dictionary_expressions", "datafusion-optimizer/dictionary_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", "datafusion-row/jit"]
pyarrow = ["datafusion-common/pyarrow"]
-regex_expressions = ["datafusion-physical-expr/regex_expressions"]
+regex_expressions = ["datafusion-physical-expr/regex_expressions", "datafusion-optimizer/regex_expressions"]
# Used to enable scheduler
scheduler = ["rayon"]
simd = ["arrow/simd"]
-unicode_expressions = ["datafusion-physical-expr/regex_expressions", "datafusion-sql/unicode_expressions"]
+unicode_expressions = ["datafusion-physical-expr/unicode_expressions", "datafusion-optimizer/unicode_expressions", "datafusion-sql/unicode_expressions"]
[dependencies]
ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] }
@@ -71,8 +71,8 @@ datafusion-common = { path = "../common", version = "19.0.0", features = ["parqu
datafusion-execution = { path = "../execution", version = "19.0.0" }
datafusion-expr = { path = "../expr", version = "19.0.0" }
datafusion-jit = { path = "../jit", version = "19.0.0", optional = true }
-datafusion-optimizer = { path = "../optimizer", version = "19.0.0" }
-datafusion-physical-expr = { path = "../physical-expr", version = "19.0.0" }
+datafusion-optimizer = { path = "../optimizer", version = "19.0.0", default-features = false }
+datafusion-physical-expr = { path = "../physical-expr", version = "19.0.0", default-features = false }
datafusion-row = { path = "../row", version = "19.0.0" }
datafusion-sql = { path = "../sql", version = "19.0.0" }
flate2 = { version = "1.0.24", optional = true }
diff --git a/datafusion/optimizer/Cargo.toml b/datafusion/optimizer/Cargo.toml
index f2dcbfefd2..12a01e5d29 100644
--- a/datafusion/optimizer/Cargo.toml
+++ b/datafusion/optimizer/Cargo.toml
@@ -33,8 +33,11 @@ name = "datafusion_optimizer"
path = "src/lib.rs"
[features]
-default = ["unicode_expressions"]
-unicode_expressions = []
+crypto_expressions = ["datafusion-physical-expr/crypto_expressions"]
+default = ["unicode_expressions", "crypto_expressions", "regex_expressions"]
+dictionary_expressions = ["datafusion-physical-expr/dictionary_expressions"]
+regex_expressions = ["datafusion-physical-expr/regex_expressions"]
+unicode_expressions = ["datafusion-physical-expr/unicode_expressions"]
[dependencies]
arrow = { version = "34.0.0", features = ["prettyprint"] }
@@ -42,7 +45,7 @@ async-trait = "0.1.41"
chrono = { version = "0.4.23", default-features = false }
datafusion-common = { path = "../common", version = "19.0.0" }
datafusion-expr = { path = "../expr", version = "19.0.0" }
-datafusion-physical-expr = { path = "../physical-expr", version = "19.0.0" }
+datafusion-physical-expr = { path = "../physical-expr", version = "19.0.0", default-features = false }
hashbrown = { version = "0.13", features = ["raw"] }
itertools = "0.10"
log = "^0.4"