Dandandan commented on a change in pull request #513:
URL: https://github.com/apache/arrow-datafusion/pull/513#discussion_r646036515



##########
File path: datafusion/src/optimizer/constant_folding.rs
##########
@@ -247,6 +248,25 @@ impl<'a> ExprRewriter for ConstantRewriter<'a> {
                     }
                 }
             }
+            Expr::Cast {
+                expr: inner,
+                data_type,
+            } => match inner.as_ref() {
+                Expr::Literal(val) => {
+                    let scalar_array = val.to_array();

Review comment:
       Great idea👍 I think converting to an array is the best we can do for 
now, without duplicating the code.
   




-- 
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.

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


Reply via email to