Skip to content

Commit 100b30e

Browse files
Minor: fix signature fn octect_length() (#10726)
* fix: signature fn octect_length * chore: add test
1 parent 7948183 commit 100b30e

File tree

2 files changed

+19
-2
lines changed
  • datafusion

2 files changed

+19
-2
lines changed

datafusion/core/tests/expr_api/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ use std::sync::{Arc, OnceLock};
2828

2929
mod simplification;
3030

31+
#[test]
32+
fn test_octet_length() {
33+
#[rustfmt::skip]
34+
evaluate_expr_test(
35+
octet_length(col("list")),
36+
vec![
37+
"+------+",
38+
"| expr |",
39+
"+------+",
40+
"| 5 |",
41+
"| 18 |",
42+
"| 6 |",
43+
"+------+",
44+
],
45+
);
46+
}
47+
3148
#[test]
3249
fn test_eq() {
3350
// id = '2'

datafusion/functions/src/string/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ pub mod expr_fn {
128128
}
129129

130130
#[doc = "returns the number of bytes of a string"]
131-
pub fn octet_length(args: Vec<Expr>) -> Expr {
132-
super::octet_length().call(args)
131+
pub fn octet_length(args: Expr) -> Expr {
132+
super::octet_length().call(vec![args])
133133
}
134134

135135
#[doc = "replace the substring of string that starts at the start'th character and extends for count characters with new substring"]

0 commit comments

Comments
 (0)