You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/03/01 17:56:56 UTC
[GitHub] [arrow] elferherrera commented on a change in pull request #9567: ARROW-11775: [Rust][DataFusion] Feature Flags for Dependencies
elferherrera commented on a change in pull request #9567:
URL: https://github.com/apache/arrow/pull/9567#discussion_r584929370
##########
File path: rust/datafusion/src/physical_plan/functions.rs
##########
@@ -447,6 +446,26 @@ pub fn return_type(
}
}
+#[cfg(feature = "crypto_expressions")]
+macro_rules! invoke_if_crypto_expressions_feature_flag {
+ ($FUNC:ident, $NAME:expr) => {{
+ use crate::physical_plan::crypto_expressions;
+ crypto_expressions::$FUNC
+ }};
+}
+
+#[cfg(not(feature = "crypto_expressions"))]
Review comment:
I think you can put the `#[cfg(feature)]` inside the macro so you dont have to maintain two funtions
What do you think?
```
macro_rules! invoke_if_crypto_expressions_feature_flag {
($FUNC:ident, $NAME:expr) => {
#[cfg(not(feature = "crypto_expressions"))]
{
|_: &[ColumnarValue]| -> Result<ColumnarValue> {
Err(DataFusionError::Internal(format!(
"function {} requires compilation with feature flag: crypto_expressions.",
$NAME
)))
}
}
#[cfg(feature = "crypto_expressions")]
{
use crate::physical_plan::crypto_expressions;
crypto_expressions::$FUNC
}
};
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org