korowa commented on code in PR #14236: URL: https://github.com/apache/datafusion/pull/14236#discussion_r1927474710
########## datafusion/functions-nested/src/repeat.rs: ########## @@ -136,7 +137,17 @@ pub fn array_repeat_inner(args: &[ArrayRef]) -> Result<ArrayRef> { } let element = &args[0]; - let count_array = as_int64_array(&args[1])?; + let count_array = &args[1]; + + let count_array = match count_array.data_type() { + DataType::Int8 | DataType::Int16 | DataType::Int32 => { + &cast(count_array, &DataType::Int64)? + } + DataType::Int64 => count_array, + _ => return exec_err!("count must be an integer type"), + }; + + let count_array = as_int64_array(&count_array)?; Review Comment: By target type I've meant conversion to UInt internallly instead of Int, so it wouldn't affect any input arguments, only prevent this function from panicking on negative values (but I thought it would return cast error :thinking: ), so I don't think it's a breaking change. -- 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