andygrove commented on code in PR #500:
URL: https://github.com/apache/datafusion-comet/pull/500#discussion_r1631494622


##########
core/src/execution/datafusion/planner.rs:
##########
@@ -499,7 +497,12 @@ impl PhysicalPlanner {
                 let child = self.create_expr(expr.child.as_ref().unwrap(), 
input_schema.clone())?;
                 let return_type = child.data_type(&input_schema)?;
                 let args = vec![child];
-                let scalar_def = ScalarFunctionDefinition::UDF(math::abs());
+                let eval_mode = EvalMode::try_from(expr.eval_mode)?;

Review Comment:
   It would be more idiomatic to use `try_into` here.
   
   ```suggestion
                   let eval_mode = expr.eval_mode.try_into()?;
   ```
   



##########
core/src/execution/datafusion/planner.rs:
##########
@@ -356,11 +358,7 @@ impl PhysicalPlanner {
                 let child = self.create_expr(expr.child.as_ref().unwrap(), 
input_schema)?;
                 let datatype = 
to_arrow_datatype(expr.datatype.as_ref().unwrap());
                 let timezone = expr.timezone.clone();
-                let eval_mode = match 
spark_expression::EvalMode::try_from(expr.eval_mode)? {
-                    spark_expression::EvalMode::Legacy => EvalMode::Legacy,
-                    spark_expression::EvalMode::Try => EvalMode::Try,
-                    spark_expression::EvalMode::Ansi => EvalMode::Ansi,
-                };
+                let eval_mode = EvalMode::try_from(expr.eval_mode)?;

Review Comment:
   It would be more idiomatic to use `try_into` here.
   
   ```suggestion
                   let eval_mode = expr.eval_mode.try_into()?;
   ```



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to