-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
The place parses literal to ScalarValue doesn't care about the target data type. This may require somebody to cast the parsed ScalarValue to expected data type
Describe the solution you'd like
Add a method to ScalarValue like:
fn cast(&self, data_type: &DataType, force: bool) -> Option<ScalarValue>;The third parameter force is a switch to whether perform force cast like cast integer to float or string to number. Without force this method only perform lossless cast (i.e., only cast to bigger type)
Describe alternatives you've considered
For logical plan we can wrap a Cast over Literal to get the same result.
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request