2010YOUY01 commented on code in PR #22386:
URL: https://github.com/apache/datafusion/pull/22386#discussion_r3291896368
##########
datafusion/functions/src/string/common.rs:
##########
@@ -520,6 +520,10 @@ fn case_conversion_utf8view_ascii_inner<F: Fn(&u8) -> u8>(
block_size = block_size.saturating_mul(2);
}
let to_reserve = len.max(block_size as usize);
+ #[expect(
Review Comment:
Thank you for the review -- this is a good point.
I believe using the unsafe API here is an intentional performance tradeoff,
I've updated the doc to make it clear:
```
reason = "StringView's block size bounds growth, so reserve cannot overflow
capacity arithmetically. This hot loop intentionally avoids the extra
`try_reserve` checks. It remains subject to allocator failure/OOM, which must
be managed externally."
```
--
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]