Skip to content

[SPARK-16582][SQL] Explicitly define isNull = false for non-nullable expressions - #14227

Closed
sameeragarwal wants to merge 1 commit into
apache:masterfrom
sameeragarwal:codegen
Closed

[SPARK-16582][SQL] Explicitly define isNull = false for non-nullable expressions#14227
sameeragarwal wants to merge 1 commit into
apache:masterfrom
sameeragarwal:codegen

Conversation

@sameeragarwal

Copy link
Copy Markdown
Member

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

@SparkQA

Copy link
Copy Markdown

Test build #62396 has finished for PR 14227 at commit 6bbb56f.

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

@sameeragarwal

Copy link
Copy Markdown
MemberAuthor

cc @ericl

@ericl

Copy link
Copy Markdown
Contributor

Lgtm

@rxin

rxin commented Jul 16, 2016

Copy link
Copy Markdown
Contributor

Merging in master/2.0.

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>
""")
} else {
ev.copy(code = s"""
boolean ${ev.isNull} = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't quite understand this, we explicitly define isNull = "false" below, how could ev.isNull be referenced later?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@cloud-fan ideally it shouldn't be referenced but we recently discovered these incorrect patterns in the code (e.g., https://github.com/apache/spark/pull/14168/files#diff-39298b470865a4cbc67398a4ea11e767L290) where the non-nullable branches were not explicitly tested. This change was just a defensive measure for codegen to not break in those cases. Let me also add a comment here to reduce confusion.

Sign up for freeto 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

@sameeragarwal@SparkQA@ericl@rxin@cloud-fan