Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xinlifoobar committed Aug 20, 2024
1 parent d5b63f4 commit 2acd148
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datafusion/functions/src/regex/regexpcount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn regexp_count_func(args: &[ArrayRef]) -> Result<ArrayRef> {
DataType::Utf8 => regexp_count::<i32>(args),
DataType::LargeUtf8 => regexp_count::<i64>(args),
other => {
internal_err!("Unsupported data type {other:?} for function regexp_like")
internal_err!("Unsupported data type {other:?} for function regexp_count")
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions datafusion/sqllogictest/test_files/regexp.slt
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ statement error
External error: query failed: DataFusion error: Arrow error: Compute error: regexp_count() requires start to be 1 based
SELECT regexp_count('123123123123', '123', -3);

statement error
External error: statement failed: DataFusion error: Arrow error: Compute error: regexp_count() does not support global flag
SELECT regexp_count('123123123123', '123', 1, 'g');

query I
SELECT regexp_count(str, '\w') from t;
----
Expand Down

0 comments on commit 2acd148

Please sign in to comment.