Skip to content

Commit

Permalink
Minor: fix signature fn octect_length() (#10726)
Browse files Browse the repository at this point in the history
* fix: signature fn octect_length

* chore: add test
  • Loading branch information
marvinlanhenke authored May 30, 2024
1 parent 7948183 commit 100b30e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions datafusion/core/tests/expr_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ use std::sync::{Arc, OnceLock};

mod simplification;

#[test]
fn test_octet_length() {
#[rustfmt::skip]
evaluate_expr_test(
octet_length(col("list")),
vec![
"+------+",
"| expr |",
"+------+",
"| 5 |",
"| 18 |",
"| 6 |",
"+------+",
],
);
}

#[test]
fn test_eq() {
// id = '2'
Expand Down
4 changes: 2 additions & 2 deletions datafusion/functions/src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ pub mod expr_fn {
}

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

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

0 comments on commit 100b30e

Please sign in to comment.