jayzhan211 commented on code in PR #10358:
URL: https://github.com/apache/datafusion/pull/10358#discussion_r1588616971
##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -450,6 +463,9 @@ impl<'a> TreeNodeRewriter for ConstEvaluator<'a> {
ConstSimplifyResult::Simplified(s) => {
Ok(Transformed::yes(Expr::Literal(s)))
}
+ ConstSimplifyResult::NotSimplified(s) => {
Review Comment:
I think we can define `NotSimplified` without value, so we might not
accidentally return a "simplified/rewritten" expr back
```rust
enum ConstSimplifyResult {
// Expr was simplifed and contains the new expression
Simplified(ScalarValue),
// Expr was not simplified and original value is returned
NotSimplified,
// Evaluation encountered an error, contains the original expression
SimplifyRuntimeError(DataFusionError, Expr),
}
ConstSimplifyResult::NotSimplified => {
Ok(Transformed::no(expr))
}
```
--
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]