Skip to content

Commit 185437e

Browse files
committed
removed un-needed ut8 check
1 parent 5d6a9b0 commit 185437e

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

  • datafusion/physical-plan/src/aggregates/group_values/single_group_by

datafusion/physical-plan/src/aggregates/group_values/single_group_by/dictionary.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ macro_rules! decode_list {
4949
if len == -1 {
5050
builder.values().append_null();
5151
} else {
52-
let s = std::str::from_utf8(
53-
&raw_vector[offset..offset + len as usize],
54-
)
55-
.map_err(|e| {
56-
Internal(format!("Invalid utf8 in list element: {e}"))
57-
})?;
52+
let s = unsafe { std::str::from_utf8_unchecked(raw_vector) };
5853
builder.values().append_value(s);
5954
offset += len as usize;
6055
}
@@ -72,9 +67,7 @@ macro_rules! decode_scalar_string {
7267
for raw_bytes in $raw {
7368
match raw_bytes {
7469
Some(raw_vector) => {
75-
let s = std::str::from_utf8(raw_vector).map_err(|e| {
76-
Internal(format!("Invalid utf8 in GroupValuesDictionary: {e}"))
77-
})?;
70+
let s = unsafe { std::str::from_utf8_unchecked(raw_vector) };
7871
builder.append_value(s);
7972
}
8073
None => builder.append_null(),

0 commit comments

Comments
 (0)