tinfoil-knight commented on code in PR #9869: URL: https://github.com/apache/arrow-datafusion/pull/9869#discussion_r1545482647
########## datafusion/functions/src/math/mod.rs: ########## @@ -24,10 +24,14 @@ mod nans; make_udf_function!(nans::IsNanFunc, ISNAN, isnan); make_udf_function!(abs::AbsFunc, ABS, abs); -make_math_unary_udf!(TanhFunc, TANH, tanh, tanh); -make_math_unary_udf!(AcosFunc, ACOS, acos, acos); -make_math_unary_udf!(AsinFunc, ASIN, asin, asin); -make_math_unary_udf!(TanFunc, TAN, tan, tan); +make_math_unary_udf!(Log2Func, LOG2, log2, log2, Some(vec![Some(true)])); Review Comment: @alamb I tried this readability fix but Rust doesn't allow allocation (which `vec![]` needs) in `const` or `static` items. Global `let` is also not allowed. The compiler suggested this with static: ``` consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell ``` We use `once_cell` in the `physical_plan` crate but introducing it to datafusion functions just for this doesn't seem right to me. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
