andygrove commented on code in PR #16350:
URL: https://github.com/apache/datafusion/pull/16350#discussion_r2137801705


##########
datafusion/spark/src/function/hash/sha2.rs:
##########
@@ -138,80 +138,140 @@ impl ScalarUDFImpl for SparkSha2 {
 
 pub fn sha2(args: [ColumnarValue; 2]) -> Result<ColumnarValue> {
     match args {
-        [ColumnarValue::Scalar(ScalarValue::Utf8(expr_arg)), 
ColumnarValue::Scalar(ScalarValue::UInt32(Some(bit_length_arg)))] => {

Review Comment:
   I think that we could just change `UInt32` to `Int32` rather than adding 
support to both. The `coerce_types` methods will then take care of coercing the 
input value to an `Int32` for anyone using this function with DataFusion.



##########
datafusion/spark/src/function/hash/sha2.rs:
##########
@@ -138,80 +138,140 @@ impl ScalarUDFImpl for SparkSha2 {
 
 pub fn sha2(args: [ColumnarValue; 2]) -> Result<ColumnarValue> {
     match args {
-        [ColumnarValue::Scalar(ScalarValue::Utf8(expr_arg)), 
ColumnarValue::Scalar(ScalarValue::UInt32(Some(bit_length_arg)))] => {

Review Comment:
   I think that we could just change `UInt32` to `Int32` rather than adding 
support for both. The `coerce_types` methods will then take care of coercing 
the input value to an `Int32` for anyone using this function with DataFusion.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to