comphead commented on code in PR #23766:
URL: https://github.com/apache/datafusion/pull/23766#discussion_r3634091608


##########
datafusion/spark/src/function/math/hex.rs:
##########
@@ -233,7 +184,7 @@ fn hex_encode_int64(
     for v in iter {
         if let Some(num) = v {
             let mut temp = [0u8; 16];
-            let slice = hex_int64(num, &mut temp);
+            let slice = encode_u64(num as u64, HexCase::Upper, &mut temp);

Review Comment:
   this just caught my eye when using u64 for hex.
   
   hex still supports negative input
   
   ```
   scala> spark.sql("select hex(1)").show(false)
   +------+
   |hex(1)|
   +------+
   |1     |
   +------+
   
   
   scala> spark.sql("select hex(-2)").show(false)
   +----------------+
   |hex(-2)         |
   +----------------+
   |FFFFFFFFFFFFFFFE|
   +----------------+
   
   ```



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