Skip to content

Conversation

@sameeragarwal
Copy link
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

SparkQA commented Jul 16, 2016

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
Member Author

cc @ericl

@ericl
Copy link
Contributor

ericl commented Jul 16, 2016

Lgtm

@rxin
Copy link
Contributor

rxin commented Jul 16, 2016

Merging in master/2.0.

@asfgit asfgit closed this in a1ffbad Jul 16, 2016
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
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
Member Author

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 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