Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Feb 12, 2020

What changes were proposed in this pull request?

Added new test to RegexpExpressionsSuite which checks that cache of compiled pattern is set when the right expression (pattern in LIKE) is a foldable expression.

Why are the changes needed?

To be sure that cache in StringRegexExpression is initialized for foldable patterns.

Does this PR introduce any user-facing change?

No

How was this patch tested?

By running the added test in RegexpExpressionsSuite.

@MaxGekk MaxGekk changed the title [WIP][SPARK-30759][SQL][TESTS][FOLLOWUP] Check cache initialization in StringRegexExpression [SPARK-30759][SQL][TESTS][FOLLOWUP] Check cache initialization in StringRegexExpression Feb 12, 2020
@SparkQA
Copy link

SparkQA commented Feb 12, 2020

Test build #118289 has finished for PR 27547 at commit d48f4c3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 12, 2020

Test build #118293 has finished for PR 27547 at commit 3b65bb6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan cloud-fan closed this in 61b1e60 Feb 12, 2020
@cloud-fan
Copy link
Contributor

thanks, merging to master!

@dongjoon-hyun
Copy link
Member

Late LGTM. Thank you, @MaxGekk , @HyukjinKwon , @cloud-fan .

MaxGekk added a commit to MaxGekk/spark that referenced this pull request Feb 26, 2020
…ingRegexExpression

### What changes were proposed in this pull request?
Added new test to `RegexpExpressionsSuite` which checks that `cache` of compiled pattern is set when the `right` expression (pattern in `LIKE`) is a foldable expression.

### Why are the changes needed?
To be sure that `cache` in `StringRegexExpression` is initialized for foldable patterns.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
By running the added test in `RegexpExpressionsSuite`.

Closes apache#27547 from MaxGekk/regexp-cache-test.

Authored-by: Maxim Gekk <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
dongjoon-hyun pushed a commit that referenced this pull request Feb 26, 2020
…sion

### What changes were proposed in this pull request?
In the PR, I propose to fix `cache` initialization in `StringRegexExpression` by changing of expected value type in `case Literal(value: String, StringType)` from `String` to `UTF8String`.

This is a backport of #27502 and #27547

### Why are the changes needed?
Actually, the case doesn't work at all because `Literal`'s value has type `UTF8String`, see
<img width="649" alt="Screen Shot 2020-02-08 at 22 45 50" src="https://user-images.githubusercontent.com/1580697/74091681-0d4a2180-4acb-11ea-8a0d-7e8c65f4214e.png">

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
Added new test by `RegexpExpressionsSuite`.

Closes #27713 from MaxGekk/str-regexp-foldable-pattern-backport.

Authored-by: Maxim Gekk <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun pushed a commit that referenced this pull request Feb 26, 2020
…sion

In the PR, I propose to fix `cache` initialization in `StringRegexExpression` by changing of expected value type in `case Literal(value: String, StringType)` from `String` to `UTF8String`.

This is a backport of #27502 and #27547

Actually, the case doesn't work at all because `Literal`'s value has type `UTF8String`, see
<img width="649" alt="Screen Shot 2020-02-08 at 22 45 50" src="https://user-images.githubusercontent.com/1580697/74091681-0d4a2180-4acb-11ea-8a0d-7e8c65f4214e.png">

No

Added new test by `RegexpExpressionsSuite`.

Closes #27713 from MaxGekk/str-regexp-foldable-pattern-backport.

Authored-by: Maxim Gekk <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit cfc48a8)
Signed-off-by: Dongjoon Hyun <[email protected]>
sjincho pushed a commit to sjincho/spark that referenced this pull request Apr 15, 2020
…ingRegexExpression

### What changes were proposed in this pull request?
Added new test to `RegexpExpressionsSuite` which checks that `cache` of compiled pattern is set when the `right` expression (pattern in `LIKE`) is a foldable expression.

### Why are the changes needed?
To be sure that `cache` in `StringRegexExpression` is initialized for foldable patterns.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
By running the added test in `RegexpExpressionsSuite`.

Closes apache#27547 from MaxGekk/regexp-cache-test.

Authored-by: Maxim Gekk <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
@MaxGekk MaxGekk deleted the regexp-cache-test branch June 5, 2020 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants