neilconway commented on code in PR #26377:
URL: https://github.com/apache/datafusion/pull/26377#discussion_r4287185779
##########
datafusion/functions/src/strings.rs:
##########
@@ -1753,16 +1796,27 @@ mod tests {
#[test]
fn string_view_builder_try_append_success_path() {
- let mut builder = StringViewArrayBuilder::with_capacity(3);
+ let mut builder = StringViewArrayBuilder::with_capacity(5);
builder.try_append_value("abc").unwrap();
builder.try_append_placeholder().unwrap();
builder.try_append_value("a long string value").unwrap();
+ // SAFETY: ASCII inputs and ASCII outputs.
+ unsafe {
+ builder
+ .try_append_byte_map(b"de", |b| b.to_ascii_uppercase())
+ .unwrap();
+ builder
+ .try_append_byte_map(b"a long mapped value", |b|
b.to_ascii_uppercase())
+ .unwrap();
+ }
- let nulls = Some(NullBuffer::from(vec![true, false, true]));
+ let nulls = Some(NullBuffer::from(vec![true, false, true, true,
true]));
Review Comment:
Thanks, good catch! Done.
--
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]