comphead commented on code in PR #18662:
URL: https://github.com/apache/datafusion/pull/18662#discussion_r2525655921
##########
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:
Right so idea of internal is highlight something really unexpected happening
like a guard saying there is internal engine bug.
Will it trigger if user calls the crc32 with invalid param like
```
select crc32(arrow_cast(null, 'Dictionary(Int32, Utf8)'))
```
--
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]