Jefffrey commented on code in PR #18662:
URL: https://github.com/apache/datafusion/pull/18662#discussion_r2525565642
##########
datafusion/spark/src/function/hash/crc32.rs:
##########
@@ -124,11 +113,12 @@ fn spark_crc32(args: &[ArrayRef]) -> Result<ArrayRef> {
let input = as_binary_view_array(input)?;
Ok(spark_crc32_impl(input.iter()))
}
- _ => {
- exec_err!(
- "Spark `crc32` function: argument must be binary or large
binary, got {:?}",
- input.data_type()
- )
+ DataType::FixedSizeBinary(_) => {
+ let input = as_fixed_size_binary_array(input)?;
+ Ok(spark_crc32_impl(input.iter()))
+ }
+ dt => {
+ internal_err!("Unsupported data type for crc32: {dt}")
Review Comment:
I switched them to `internal_err` as during normal execution these errors
should never occur; the signature should guard against them for us, so only if
something went wrong with the signature/coercion logic elsewhere in the engine
would we run into these errors (hence considered an internal error)
--
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]