Skip to content

Commit

Permalink
Stateless Row Format (apache#4811)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Sep 15, 2023
1 parent 229bf8b commit a848001
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions arrow-row/src/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,8 @@ pub fn decode_binary<I: OffsetSizeTrait>(
pub unsafe fn decode_string<I: OffsetSizeTrait>(
rows: &mut [&[u8]],
options: SortOptions,
validate_utf8: bool,
_validate_utf8: bool,
) -> GenericStringArray<I> {
let decoded = decode_binary::<I>(rows, options);

if validate_utf8 {
return GenericStringArray::from(decoded);
}

let builder = decoded
.into_data()
.into_builder()
.data_type(GenericStringArray::<I>::DATA_TYPE);

// SAFETY:
// Row data must have come from a valid UTF-8 array
GenericStringArray::from(builder.build_unchecked())
return GenericStringArray::from(decoded);
}

0 comments on commit a848001

Please sign in to comment.