kosiew commented on code in PR #22305:
URL: https://github.com/apache/datafusion/pull/22305#discussion_r3292600385
##########
datafusion/functions-nested/src/repeat.rs:
##########
@@ -320,3 +374,22 @@ fn get_count_with_validity(count_array: &Int64Array, idx:
usize) -> usize {
if c > 0 { c as usize } else { 0 }
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::array_repeat_inner;
+ use arrow::array::{ArrayRef, Int64Array};
+ use std::sync::Arc;
+
+ #[test]
+ fn scalar_count_exceeding_max_array_size_returns_error() {
Review Comment:
Nice addition to cover the overflow path 👍
I noticed the regression test exercises `array_repeat_inner` directly, while
the original reproducer was SQL-visible (`SELECT array_repeat(1,
9223372036854775807)`). It could be helpful to also add an SLT error case under
`datafusion/sqllogictest/test_files/array/array_repeat.slt` so the SQL
execution path and scalar-to-array wrapper are covered end-to-end as well.
--
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]