shahwazreza commented on code in PR #26957:
URL: https://github.com/apache/datafusion/pull/26957#discussion_r4485817578
##########
datafusion/functions/src/string/repeat.rs:
##########
@@ -22,6 +22,15 @@ use datafusion_expr_common::signature::{Coercion,
TypeSignatureClass};
use datafusion_expr_common::sort_properties::ExprProperties;
use datafusion_macros::user_doc;
+/// Largest result, in bytes, that `repeat` produces for `LargeUtf8`, both for
a
+/// single value and for the total of an array.
+///
+/// `LargeUtf8` offsets would allow up to `i64::MAX` bytes, but the result is
+/// allocated up front, and an allocation larger than the address space aborts
+/// the process instead of returning an error. This cap matches DuckDB's string
+/// size limit and is about twice the `Utf8` limit of `i32::MAX`.
+const LARGE_UTF8_MAX_SIZE: usize = u32::MAX as usize;
Review Comment:
Makes sense, thanks. I trimmed it to your suggested wording in 8ca4139. The
reasoning for picking u32::MAX stays in the PR description.
--
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]