paleolimbot commented on code in PR #23169:
URL: https://github.com/apache/datafusion/pull/23169#discussion_r3483694662


##########
datafusion/physical-expr/src/expressions/cast.rs:
##########
@@ -63,6 +64,10 @@ pub struct CastExpr {
     target_field: FieldRef,
     /// Cast options
     cast_options: CastOptions<'static>,
+    /// Whether to preserve non-extension metadata from the source field.
+    /// When true (default), source metadata is merged with target metadata.
+    /// When false, only the target field's metadata is used.
+    preserve_source_metadata: bool,

Review Comment:
   This is a little gross feeling to me, but there's at least one place in the 
code that is counting on `Cast::return_field()` *not* to execute its child's 
`return_field()`: the virtual row number rewrite requires that the cast strips 
metadata and does not validate its child's `Column` (which is invalid, at least 
where it's tested). There may be a better way here.



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