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