ryux1 commented on code in PR #24971:
URL: https://github.com/apache/datafusion/pull/24971#discussion_r3982192818


##########
datafusion/sql/src/statement.rs:
##########
@@ -2953,6 +2953,25 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
                         })
                         .cast_to(target_field.data_type(), 
&DFSchema::empty())?,
                 };
+                let (_, expr_field) = expr.to_field(source.schema())?;
+                // A storage-type cast alone does not apply extension metadata 
from the
+                // table schema when the source and target storage types are 
identical.
+                let expr = if target_field.extension_type_name().is_none()
+                    || expr_field.metadata() == target_field.metadata()

Review Comment:
   Thanks, confirmed. The new case uses the UUID-extension table as both source 
and target and the snapshot shows a plain projection with no redundant 
field-aware cast, so it covers the equality no-op path I had in mind.



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