Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regexp_replace fails when pattern or replacement is a scalar NULL #11459

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

Weijun-H
Copy link
Member

Which issue does this PR close?

Closes #11410

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jul 14, 2024
@Weijun-H Weijun-H changed the title fix: gexp_replace fails when pattern or replacement is a scalar NULL fix: regexp_replace fails when pattern or replacement is a scalar NULL Jul 14, 2024
@Weijun-H Weijun-H changed the title fix: regexp_replace fails when pattern or replacement is a scalar NULL fix: regexp_replace fails when pattern or replacement is a scalar NULL Jul 14, 2024
Copy link
Member

@jonahgao jonahgao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@@ -309,6 +309,12 @@ SELECT regexp_replace(arrow_cast('foobar', 'Dictionary(Int32, Utf8)'), 'bar', 'x
----
fooxx

query TT
select regexp_replace(col, NULL, 'c'), regexp_replace(col, 'a', NULL) from (values ('a'), ('b')) as tbl(col);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we also need a test with flags is null

datafusion/functions/src/regex/regexpreplace.rs Outdated Show resolved Hide resolved
@alamb
Copy link
Contributor

alamb commented Jul 15, 2024

Thank you @Weijun-H and @jonahgao

@alamb alamb merged commit 7bd0e74 into apache:main Jul 15, 2024
23 checks passed
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
…NULL` (apache#11459)

* fix: gexp_replace fails when pattern or replacement is a scalar NULL

* chore
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 17, 2024
…NULL` (apache#11459)

* fix: gexp_replace fails when pattern or replacement is a scalar NULL

* chore
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 18, 2024
…NULL` (apache#11459)

* fix: gexp_replace fails when pattern or replacement is a scalar NULL

* chore
wiedld pushed a commit to influxdata/arrow-datafusion that referenced this pull request Jul 31, 2024
…NULL` (apache#11459)

* fix: gexp_replace fails when pattern or replacement is a scalar NULL

* chore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regexp_replace fails when pattern or replacement is a scalar NULL
3 participants