Skip to content

Commit 290af45

Browse files
committed
Support Utf8View for string function bit_length()
Signed-off-by: Austin Liu <[email protected]>
1 parent f23360f commit 290af45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

datafusion/functions/src/string/bit_length.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ impl ScalarUDFImpl for BitLengthFunc {
7979
ScalarValue::LargeUtf8(v) => Ok(ColumnarValue::Scalar(
8080
ScalarValue::Int64(v.as_ref().map(|x| (x.len() * 8) as i64)),
8181
)),
82+
ScalarValue::Utf8View(v) => Ok(ColumnarValue::Scalar(
83+
ScalarValue::Int32(v.as_ref().map(|x| (x.len() * 8) as i32)),
84+
)),
8285
_ => unreachable!(),
8386
},
8487
}

0 commit comments

Comments
 (0)