andygrove commented on code in PR #471: URL: https://github.com/apache/datafusion-comet/pull/471#discussion_r1616098866
########## core/src/execution/datafusion/planner.rs: ########## @@ -566,8 +567,23 @@ impl PhysicalPlanner { Ok(Arc::new(NotExpr::new(child))) } ExprStruct::Negative(expr) => { - let child = self.create_expr(expr.child.as_ref().unwrap(), input_schema)?; - Ok(Arc::new(NegativeExpr::new(child))) + let child: Arc<dyn PhysicalExpr> = + self.create_expr(expr.child.as_ref().unwrap(), input_schema.clone())?; + let eval_mode = match expr.eval_mode.as_str() { + "ANSI" => EvalMode::Ansi, + "TRY" => EvalMode::Try, + "LEGACY" => EvalMode::Legacy, + other => { + return Err(ExecutionError::GeneralError(format!( + "Invalid EvalMode: \"{other}\"" + ))) + } + }; Review Comment: We can make use of the generated protobuf enum here rather than hard-code the strings. This would also allow us to remove the "other" error handling case. ```rust let eval_mode = match spark_expression::EvalMode::try_from(expr.eval_mode)? { spark_expression::EvalMode::Ansi => EvalMode::Ansi, spark_expression::EvalMode::Try => EvalMode::Try, spark_expression::EvalMode::Legacy => EvalMode::Legacy, }; ``` -- 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