andygrove commented on code in PR #415:
URL: https://github.com/apache/datafusion-comet/pull/415#discussion_r1597445680
##########
core/src/execution/datafusion/planner.rs:
##########
@@ -346,10 +346,10 @@ 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 expr.eval_mode.as_str() {
- "ANSI" => EvalMode::Ansi,
- "TRY" => EvalMode::Try,
- "LEGACY" => EvalMode::Legacy,
+ let eval_mode = match expr.eval_mode {
Review Comment:
We can make use of the generated protobuf enum here rather than hard-code
numberic values. 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::Legacy => EvalMode::Legacy,
spark_expression::EvalMode::Try => EvalMode::Try,
spark_expression::EvalMode::Ansi => EvalMode::Ansi,
};
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]