nseekhao commented on code in PR #5137:
URL: https://github.com/apache/arrow-datafusion/pull/5137#discussion_r1117330249


##########
datafusion/substrait/src/consumer.rs:
##########
@@ -679,12 +680,46 @@ pub async fn from_substrait_rex(
                 }
             }
         }
+        Some(RexType::Cast(cast)) => Ok(Arc::new(Expr::Cast(Cast::new(
+            Box::new(
+                from_substrait_rex(
+                    cast.as_ref().input.as_ref().unwrap().as_ref(),
+                    input_schema,
+                    extensions,
+                )
+                .await?
+                .as_ref()
+                .clone(),
+            ),
+            from_substrait_type(cast.as_ref().r#type.as_ref().unwrap())?,

Review Comment:
   Good point. Generally if the Substrait plan has been produced correctly, the 
`cast` expression should always have an output type. But since we cannot 
guarantee that, I added a match arm to produce appropriate error in 
[58f90ce](https://github.com/apache/arrow-datafusion/pull/5137/commits/58f90ce085583ba392ed6bbc4db90e7b0b83656b),



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