Skip to content

Commit c2f2326

Browse files
committed
maybe work?
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
1 parent 74035bc commit c2f2326

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

datafusion/functions/src/unicode/character_length.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,14 @@ where
152152
.map(|i| {
153153
// Safety: we are iterating with array.len() so the index is always valid
154154
let value = unsafe { array.value_unchecked(i) };
155-
if value.is_ascii() {
156-
T::Native::usize_as(value.len())
155+
if value.is_empty() {
156+
T::default_value()
157157
} else {
158-
T::Native::usize_as(value.chars().count())
158+
if value.is_ascii() {
159+
T::Native::usize_as(value.len())
160+
} else {
161+
T::Native::usize_as(value.chars().count())
162+
}
159163
}
160164
})
161165
.collect();

0 commit comments

Comments
 (0)