viirya commented on code in PR #9459:
URL: https://github.com/apache/arrow-datafusion/pull/9459#discussion_r1513598827


##########
datafusion/physical-expr/src/math_expressions.rs:
##########
@@ -92,8 +93,9 @@ macro_rules! downcast_arg {
     ($ARG:expr, $NAME:expr, $ARRAY_TYPE:ident) => {{
         $ARG.as_any().downcast_ref::<$ARRAY_TYPE>().ok_or_else(|| {
             DataFusionError::Internal(format!(
-                "could not cast {} to {}",
+                "could not cast {} from {} to {}",
                 $NAME,
+                $ARG.data_type(),
                 type_name::<$ARRAY_TYPE>()
             ))

Review Comment:
   When I debug, I found that it is a more useful error message to show the 
source data type too.



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

Reply via email to