Skip to content

Commit

Permalink
add length_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
universalmind303 committed Sep 26, 2024
1 parent 6cb363e commit 69c09b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/daft-sql/src/modules/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl SQLModule for SQLModuleUtf8 {
// TODO add replace variants
// parent.add("replace", f(Replace(false)));
parent.add_fn("length", Length);
parent.add_fn("length_bytes", LengthBytes);
parent.add_fn("lower", Lower);
parent.add_fn("upper", Upper);
parent.add_fn("lstrip", Lstrip);
Expand Down
2 changes: 2 additions & 0 deletions tests/sql/test_utf8_exprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_utf8_exprs():
regexp_replace(a, 'ba.', 'foo') as replace_a,
regexp_split(a, '\\s+') as regexp_split_a,
length(a) as length_a,
length_bytes(a) as length_bytes_a,
lower(a) as lower_a,
lstrip(a) as lstrip_a,
rstrip(a) as rstrip_a,
Expand Down Expand Up @@ -77,6 +78,7 @@ def test_utf8_exprs():
col("a").str.split(r"\s+", regex=True).alias("regexp_split_a"),
col("a").str.replace("ba.", "foo").alias("replace_a"),
col("a").str.length().alias("length_a"),
col("a").str.length_bytes().alias("length_bytes_a"),
col("a").str.lower().alias("lower_a"),
col("a").str.lstrip().alias("lstrip_a"),
col("a").str.rstrip().alias("rstrip_a"),
Expand Down

0 comments on commit 69c09b1

Please sign in to comment.