Jefffrey commented on code in PR #18664:
URL: https://github.com/apache/datafusion/pull/18664#discussion_r2525563004
##########
datafusion/functions/src/crypto/md5.rs:
##########
@@ -89,30 +85,10 @@ impl ScalarUDFImpl for Md5Func {
&self.signature
}
- fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
- use DataType::*;
- Ok(match &arg_types[0] {
- LargeUtf8 | LargeBinary => Utf8View,
- Utf8View | Utf8 | Binary | BinaryView => Utf8View,
- Null => Null,
- Dictionary(_, t) => match **t {
- LargeUtf8 | LargeBinary => Utf8View,
- Utf8 | Binary | BinaryView => Utf8View,
- Null => Null,
- _ => {
- return plan_err!(
- "the md5 can only accept strings but got {:?}",
- **t
- );
- }
- },
- other => {
- return plan_err!(
- "The md5 function can only accept strings. Got {other}"
- );
- }
- })
+ fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
+ Ok(DataType::Utf8View)
Review Comment:
Looks like `md5` will naturally hex the output, thus it returns a string
whereas the other digest functions return the binary output as is
--
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]