andygrove commented on code in PR #5137:
URL: https://github.com/apache/arrow-datafusion/pull/5137#discussion_r1092610290
##########
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:
It would be good to add comments about the `unwrap` calls, if they are
guaranteed always to work. I can't tell just from looking at the diff here if
they are safe or not.
--
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]