Skip to content

Commit

Permalink
fix: temporary commit to update bit_length signature to only accept n…
Browse files Browse the repository at this point in the history
…on-view Utf8s, and test does pass (due to coercion?)
  • Loading branch information
wiedld committed Dec 12, 2024
1 parent c352dce commit 4967ae6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion datafusion/functions/src/string/bit_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ impl Default for BitLengthFunc {
impl BitLengthFunc {
pub fn new() -> Self {
Self {
signature: Signature::string(1, Volatility::Immutable),
signature: Signature::uniform(
1,
vec![DataType::Utf8, DataType::LargeUtf8],
Volatility::Immutable,
),
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion datafusion/sqllogictest/test_files/string/string_view.slt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ select octet_length(column1_utf8view) from test;
7
NULL

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

query T
Expand Down

0 comments on commit 4967ae6

Please sign in to comment.