Jefffrey commented on code in PR #19235:
URL: https://github.com/apache/datafusion/pull/19235#discussion_r2605282326


##########
datafusion/spark/src/function/math/hex.rs:
##########
@@ -421,4 +411,21 @@ mod test {
 
         assert_eq!(string_array, &expected_array);
     }
+
+    #[test]
+    fn test_hex_multiple_arguments() {

Review Comment:
   Could we move this to SLT instead?



##########
datafusion/spark/src/function/math/hex.rs:
##########
@@ -52,8 +55,35 @@ impl Default for SparkHex {
 
 impl SparkHex {
     pub fn new() -> Self {
+        let int64 = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_int64()),
+            vec![TypeSignatureClass::Numeric],
+            NativeType::Int64,
+        );
+        let string = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_string()),
+            vec![TypeSignatureClass::Native(logical_string())],
+            NativeType::String,
+        );

Review Comment:
   ```suggestion
           let string = Coercion::new_exact(
               TypeSignatureClass::Native(logical_string()),
           );
   ```
   
   No need to coerce from itself



##########
datafusion/spark/src/function/math/hex.rs:
##########
@@ -52,8 +54,33 @@ impl Default for SparkHex {
 
 impl SparkHex {
     pub fn new() -> Self {
+        let int64 = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_int64()),
+            vec![TypeSignatureClass::Integer, TypeSignatureClass::Numeric],
+            NativeType::Int64,
+        );
+        let string = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_string()),
+            vec![TypeSignatureClass::Native(logical_string())],
+            NativeType::String,
+        );
+        let binary = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_binary()),
+            vec![TypeSignatureClass::Binary],

Review Comment:
   This seems a bug if `logical_binary()` doesn't cover LargeBinary; can we fix 
this at the root cause instead of having a workaround?



##########
datafusion/spark/src/function/math/hex.rs:
##########
@@ -240,6 +220,16 @@ pub fn compute_hex(
 
                 Ok(ColumnarValue::Array(Arc::new(hexed)))
             }
+            DataType::LargeBinary => {

Review Comment:
   Can we add an SLT test for largebinary?



-- 
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]

Reply via email to