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/10/17 00:37:02 UTC

[GitHub] [arrow-datafusion] houqp commented on a change in pull request #1128: Generalized constant folding

houqp commented on a change in pull request #1128:
URL: https://github.com/apache/arrow-datafusion/pull/1128#discussion_r730204045



##########
File path: datafusion/src/physical_plan/expressions/mod.rs
##########
@@ -52,7 +52,60 @@ mod try_cast;
 
 /// Module with some convenient methods used in expression building
 pub mod helpers {
+
     pub use super::min_max::{max, min};
+
+    use crate::error::{DataFusionError, Result};
+    use crate::logical_plan::{DFSchema, Expr};
+    use crate::scalar::ScalarValue;
+    use arrow::datatypes::{DataType, Field};
+    use arrow::record_batch::RecordBatch;
+    ///Evaluate calculates the value of scalar expressions. This function may panic if non-constant expressions are present within the expression
+    pub fn evaluate(expr: &Expr) -> Result<ScalarValue> {

Review comment:
       perhaps this should live inside optimizer module instead? do we expect physical plan module to ever invoke this helper function?




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org