notfilippo commented on code in PR #11160:
URL: https://github.com/apache/datafusion/pull/11160#discussion_r1662578276
##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -3270,6 +3271,118 @@ impl TryFrom<&DataType> for ScalarValue {
}
}
+
+impl TryFrom<LogicalType> for ScalarValue {
+ type Error = DataFusionError;
+
+ /// Create a Null instance of ScalarValue for this datatype
+ fn try_from(datatype: LogicalType) -> Result<Self> {
+ (&datatype).try_into()
+ }
+}
+
+impl TryFrom<&LogicalType> for ScalarValue {
+ type Error = DataFusionError;
+
+ /// Create a Null instance of ScalarValue for this datatype
+ fn try_from(data_type: &LogicalType) -> Result<Self> {
Review Comment:
It makes sense. I'll add a note to refactor ScalarValues at some point
--
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]