From de7dd4b10a59e914a5e26f32b593100bc1b9c01c Mon Sep 17 00:00:00 2001 From: universalmind303 Date: Thu, 31 Oct 2024 10:26:57 -0500 Subject: [PATCH] add more test cases --- src/daft-sql/src/modules/utf8.rs | 8 ++++++++ tests/sql/test_utf8_exprs.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/daft-sql/src/modules/utf8.rs b/src/daft-sql/src/modules/utf8.rs index 0afd59e9b2..b8c8ea027f 100644 --- a/src/daft-sql/src/modules/utf8.rs +++ b/src/daft-sql/src/modules/utf8.rs @@ -565,4 +565,12 @@ impl SQLFunction for SQLConcat { Ok(first) } + + fn docstrings(&self, _: &str) -> String { + "Concatenate the inputs into a single string".to_string() + } + + fn arg_names(&self) -> &'static [&'static str] { + &["...inputs"] + } } diff --git a/tests/sql/test_utf8_exprs.py b/tests/sql/test_utf8_exprs.py index 28df70dee8..61b2b88d3e 100644 --- a/tests/sql/test_utf8_exprs.py +++ b/tests/sql/test_utf8_exprs.py @@ -64,6 +64,7 @@ def test_utf8_exprs(): tokenize_encode(a, 'r50k_base') as tokenize_encode_a, tokenize_decode(tokenize_encode(a, 'r50k_base'), 'r50k_base') as tokenize_decode_a, concat(a, '---') as concat_a, + concat('--', a, a, a, '--') as concat_multi_a FROM df """ actual = daft.sql(sql).collect() @@ -107,6 +108,12 @@ def test_utf8_exprs(): col("a").str.tokenize_encode("r50k_base").alias("tokenize_encode_a"), col("a").str.tokenize_encode("r50k_base").str.tokenize_decode("r50k_base").alias("tokenize_decode_a"), col("a").str.concat("---").alias("concat_a"), + daft.lit("--") + .str.concat(col("a")) + .str.concat(col("a")) + .str.concat(col("a")) + .str.concat("--") + .alias("concat_multi_a"), ) .collect() .to_pydict()