tschwarzinger commented on code in PR #22162:
URL: https://github.com/apache/datafusion/pull/22162#discussion_r3286804687


##########
datafusion/physical-expr/src/expressions/cast.rs:
##########
@@ -332,25 +337,38 @@ pub fn cast_with_target_field(
     target_field: FieldRef,
     cast_options: Option<CastOptions<'static>>,
 ) -> Result<Arc<dyn PhysicalExpr>> {
-    let expr_type = expr.data_type(input_schema)?;
+    let expr_field = expr.return_field(input_schema)?;
+    let expr_type = expr_field.data_type();
     let cast_type = target_field.data_type();
-    if expr_type == *cast_type && is_default_target_field(&target_field) {
+    if expr_type == cast_type && is_default_target_field(&target_field) {
         return Ok(Arc::clone(&expr));
     }
 
-    let can_build_cast = if requires_nested_struct_cast(&expr_type, cast_type) 
{
+    let can_build_cast = if target_field.extension_type_name().is_some() {

Review Comment:
   I think this will be done in a follow-up PR that introduces the actual 
casting support in the extension type registry. 



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

Reply via email to