Skip to content

Commit 90423e2

Browse files
committed
fix: temporary commit to update bit_length signature to only accept non-view Utf8s, and test does pass (due to coercion?)
1 parent bd3f2dc commit 90423e2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

datafusion/functions/src/string/bit_length.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ impl Default for BitLengthFunc {
4040
impl BitLengthFunc {
4141
pub fn new() -> Self {
4242
Self {
43-
signature: Signature::string(1, Volatility::Immutable),
43+
signature: Signature::uniform(
44+
1,
45+
vec![DataType::Utf8, DataType::LargeUtf8],
46+
Volatility::Immutable,
47+
),
4448
}
4549
}
4650
}

datafusion/sqllogictest/test_files/string/string_view.slt

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ select octet_length(column1_utf8view) from test;
9191
7
9292
NULL
9393

94-
query error DataFusion error: Arrow error: Compute error: bit_length not supported for Utf8View
94+
# query error DataFusion error: Arrow error: Compute error: bit_length not supported for Utf8View
95+
# TODO: our patched DF branch is passing this test.
96+
# It does register the type as Utf8View, if I we leave the bit_length signature to accept all strings.
97+
# if we update the bit_length signature to only accepts non-view Utf8, it then coerces to LargeUtf8 and passes.
98+
statement ok
9599
select bit_length(column1_utf8view) from test;
96100

97101
query T

0 commit comments

Comments
 (0)