-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
The current Expr::Cast
can't represent a cast to an extension type because it uses DataType
as the target:
datafusion/datafusion/expr/src/expr.rs
Lines 1009 to 1016 in 77ec319
/// Cast expression | |
#[derive(Clone, PartialEq, Eq, PartialOrd, Hash, Debug)] | |
pub struct Cast { | |
/// The expression being cast | |
pub expr: Box<Expr>, | |
/// The `DataType` the expression will yield | |
pub data_type: DataType, | |
} |
I noticed this in #17986 because a FieldRef is a way to support extension types like UUID in SQL but this information will get dropped when constructing the logical plan.
(I'd personally love this so that we can support casting to GEOMETRY/GEOGRAPHY in SedonaDB)
Describe the solution you'd like
Update the internal representation of the Cast
to use a FieldRef or add an Option<FieldMetadata>
to it so that it can express the operation of casting to an arbitrary type.
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request