Skip to content

Commit f338f19

Browse files
authored
test: cover regexp_like multiline flag (apache#22284)
## Which issue does this PR close? - Relates to apache#22268. ## Rationale for this change The issue documents a PostgreSQL compatibility expectation for `regexp_like(E'a\nb', '^b', 'm')`: with the multiline flag, `^` should match after a newline. Current `main` already returns the expected result for the reported SQL, so this PR adds focused regression coverage to keep that behavior from drifting. ## What changes are included in this PR? This adds `regexp_like` tests for the multiline `m` flag in the SQL logic test suite and in the Rust unit tests for the scalar, array/scalar, and array/array execution paths. The adjacent no-flags SQL case remains false, documenting that the new behavior is specifically tied to `m`. ## Are these changes tested? Yes: - `cargo fmt --all --check` - `git diff --check` - `cargo test -p datafusion-functions --lib regexp_like` - `cargo test -p datafusion-sqllogictest --test sqllogictests -- regexp_like` ## Are there any user-facing changes? No. This is regression coverage for existing behavior. --------- Co-authored-by: Nanook <[email protected]>
1 parent 6644732 commit f338f19

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎datafusion/sqllogictest/test_files/regexp/regexp_like.slt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,16 @@ SELECT 'foo\nbar\nbaz' ~ 'bar';
168168
----
169169
true
170170

171+
query B
172+
SELECT regexp_like(E'a\nb', '^b', 'm');
173+
----
174+
true
175+
176+
query B
177+
SELECT regexp_like(E'a\nb', '^b');
178+
----
179+
false
180+
171181
statement error
172182
Error during planning: Cannot infer common argument type for regex operation List(Field { name: "item", data_type: Int64, nullable: true, metadata: {} }) ~ List(Field { name: "item", data_type: Int64, nullable: true, metadata: {} })
173183
select [1,2] ~ [3];

0 commit comments

Comments
 (0)