Skip to content

make regexp_replace early abort with empty input#3648

Merged
Dandandan merged 1 commit intoapache:masterfrom
isidentical:gh-3647
Sep 29, 2022
Merged

make regexp_replace early abort with empty input#3648
Dandandan merged 1 commit intoapache:masterfrom
isidentical:gh-3647

Conversation

@isidentical
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #3647.

Rationale for this change

This PR makes _regexp_replace_static_pattern_replace early abort when any of the given arrays has a size of 0. This is the same behavior for the unspecialized version, but it is hidden under .zip() calls (e.g. if any of the arrays is of zero-length, it stops without producing any input).

What changes are included in this PR?

A length check to redirect fetch_string_arg to $EARLY_ABORT. We don't do the length check on the input since when it tries to unfold itself, it will create an empty array.

Are there any user-facing changes?

Bug fix (it used to panic).

@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Sep 28, 2022
@isidentical isidentical marked this pull request as ready for review September 28, 2022 23:03
Copy link
Copy Markdown
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

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

Thanks @isidentical

@Dandandan Dandandan merged commit a9f7cac into apache:master Sep 29, 2022
@ursabot
Copy link
Copy Markdown

ursabot commented Sep 29, 2022

Benchmark runs are scheduled for baseline = 0d1cd55 and contender = a9f7cac. a9f7cac is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specialized regexp_replace should early-abort when the the input arrays are empty

3 participants