This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 100b30e135 Minor: fix signature `fn octect_length()` (#10726)
100b30e135 is described below

commit 100b30e13583badc5aa9e88861d63feb80876c5e
Author: Marvin Lanhenke <[email protected]>
AuthorDate: Fri May 31 00:57:33 2024 +0200

    Minor: fix signature `fn octect_length()` (#10726)
    
    * fix: signature fn octect_length
    
    * chore: add test
---
 datafusion/core/tests/expr_api/mod.rs  | 17 +++++++++++++++++
 datafusion/functions/src/string/mod.rs |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/datafusion/core/tests/expr_api/mod.rs 
b/datafusion/core/tests/expr_api/mod.rs
index a69f7bd484..1db5aa9f23 100644
--- a/datafusion/core/tests/expr_api/mod.rs
+++ b/datafusion/core/tests/expr_api/mod.rs
@@ -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'
diff --git a/datafusion/functions/src/string/mod.rs 
b/datafusion/functions/src/string/mod.rs
index 52411142cb..e931c49981 100644
--- a/datafusion/functions/src/string/mod.rs
+++ b/datafusion/functions/src/string/mod.rs
@@ -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"]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to