alamb opened a new issue, #14548: URL: https://github.com/apache/datafusion/issues/14548
### Is your feature request related to a problem or challenge? @findepi notes in https://github.com/apache/datafusion/pull/14541#discussion_r1946891887> Into/From is very important for readability in some cases, but it can also [be abused](https://github.com/apache/datafusion/blob/d5ff3e7c247430865590c592587ad60fdff4bcc0/datafusion/common/src/scalar/mod.rs#L3453). Sometimes just single API method is enough What I think he is saying is that to create a "null" of some type of `ScalarValue` you can use `try_from` as documented here: https://docs.rs/datafusion/latest/datafusion/common/enum.ScalarValue.html#null-handling However, this is confusing as you have to know to look for the `TryFrom` impl: https://github.com/apache/datafusion/blob/d5ff3e7c247430865590c592587ad60fdff4bcc0/datafusion/common/src/scalar/mod.rs#L3453 ### Describe the solution you'd like In addition to the `TryFrom` impl I would like to have an named method with documentation and examples . ### Describe alternatives you've considered Perhaps we could add something like `ScalarValue::try_new_null`: ``` // You can also create a null value for a given datatype: let s = ScalarValue::try_new_null(&DataType::Int32)?; ``` ### Additional context I think this is pretty well spec'd out and so woudl be a good first isseu -- 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]
