Skip to content

[SPARK-16514] [SQL] Fix various regex codegen bugs #14168

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

Closed
wants to merge 1 commit into from

Conversation

ericl
Copy link
Contributor

@ericl ericl commented Jul 13, 2016

What changes were proposed in this pull request?

RegexExtract and RegexReplace currently crash on non-nullable input due use of a hard-coded local variable name (e.g. compiles fail with java.lang.Exception: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 85, Column 26: Redefinition of local variable "m").

This changes those variables to use fresh names, and also in a few other places.

How was this patch tested?

Unit tests. @rxin

@rxin
Copy link
Contributor

rxin commented Jul 13, 2016

@ericl please open a JIRA ticket for this. Thanks.

@ericl ericl changed the title [MINOR] [SQL] Fix various regex codegen bugs [SPARK-16514] [SQL] Fix various regex codegen bugs Jul 13, 2016
@ericl
Copy link
Contributor Author

ericl commented Jul 13, 2016

Sure

@SparkQA
Copy link

SparkQA commented Jul 13, 2016

Test build #62202 has finished for PR 14168 at commit 4524d97.

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

@rxin
Copy link
Contributor

rxin commented Jul 13, 2016

Thanks - merging in master/2.0.

@sameeragarwal
Copy link
Member

@ericl as an alternative, did you consider simply defining boolean ${ev.isNull} = false; for even the non-nullable branches in nullSafeCodegen (e.g., here: https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala#L619-L624) to get around this problem? My fear is that this pattern occurs at several other places as well.

asfgit pushed a commit that referenced this pull request Jul 13, 2016
## What changes were proposed in this pull request?

RegexExtract and RegexReplace currently crash on non-nullable input due use of a hard-coded local variable name (e.g. compiles fail with `java.lang.Exception: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 85, Column 26: Redefinition of local variable "m" `).

This changes those variables to use fresh names, and also in a few other places.

## How was this patch tested?

Unit tests. rxin

Author: Eric Liang <ekl@databricks.com>

Closes #14168 from ericl/sc-3906.

(cherry picked from commit 1c58fa9)
Signed-off-by: Reynold Xin <rxin@databricks.com>
@asfgit asfgit closed this in 1c58fa9 Jul 13, 2016
asfgit pushed a commit that referenced this pull request Jul 13, 2016
## What changes were proposed in this pull request?

RegexExtract and RegexReplace currently crash on non-nullable input due use of a hard-coded local variable name (e.g. compiles fail with `java.lang.Exception: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 85, Column 26: Redefinition of local variable "m" `).

This changes those variables to use fresh names, and also in a few other places.

## How was this patch tested?

Unit tests. rxin

Author: Eric Liang <ekl@databricks.com>

Closes #14168 from ericl/sc-3906.

(cherry picked from commit 1c58fa9)
Signed-off-by: Reynold Xin <rxin@databricks.com>
@rxin
Copy link
Contributor

rxin commented Jul 13, 2016

@sameeragarwal that's a good defensive measure.

zzcclp pushed a commit to zzcclp/spark that referenced this pull request Jul 13, 2016
## What changes were proposed in this pull request?

RegexExtract and RegexReplace currently crash on non-nullable input due use of a hard-coded local variable name (e.g. compiles fail with `java.lang.Exception: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 85, Column 26: Redefinition of local variable "m" `).

This changes those variables to use fresh names, and also in a few other places.

## How was this patch tested?

Unit tests. rxin

Author: Eric Liang <ekl@databricks.com>

Closes apache#14168 from ericl/sc-3906.

(cherry picked from commit 1c58fa9)
Signed-off-by: Reynold Xin <rxin@databricks.com>
(cherry picked from commit 9808735)
asfgit pushed a commit that referenced this pull request Jul 16, 2016
…expressions

## What changes were proposed in this pull request?

This patch is just a slightly safer way to fix the issue we encountered in #14168 should this pattern re-occur at other places in the code.

## How was this patch tested?

Existing tests. Also, I manually tested that it fixes the problem in SPARK-16514 without having the proposed change in #14168

Author: Sameer Agarwal <sameerag@cs.berkeley.edu>

Closes #14227 from sameeragarwal/codegen.
asfgit pushed a commit that referenced this pull request Jul 16, 2016
…expressions

## What changes were proposed in this pull request?

This patch is just a slightly safer way to fix the issue we encountered in #14168 should this pattern re-occur at other places in the code.

## How was this patch tested?

Existing tests. Also, I manually tested that it fixes the problem in SPARK-16514 without having the proposed change in #14168

Author: Sameer Agarwal <sameerag@cs.berkeley.edu>

Closes #14227 from sameeragarwal/codegen.

(cherry picked from commit a1ffbad)
Signed-off-by: Reynold Xin <rxin@databricks.com>
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.

4 participants