Skip to content
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

[SPARK-19072][SQL] codegen of Literal should not output boxed value #16469

Closed
wants to merge 1 commit into from

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

In #16402 we made a mistake that, when double/float is infinity, the Literal codegen will output boxed value and cause wrong result.

This PR fixes this by special handling infinity to not output boxed value.

How was this patch tested?

new regression test

@cloud-fan
Copy link
Contributor Author

cc @kayousterhout @gatorsmile

@kayousterhout
Copy link
Contributor

Thanks for the quick fix!

@SparkQA
Copy link

SparkQA commented Jan 4, 2017

Test build #70855 has finished for PR 16469 at commit b382117.

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

@cloud-fan
Copy link
Contributor Author

cloud-fan commented Jan 4, 2017

some more explanation: when Literal codegen produce boxed values, the double equality will break, because the code is (Double.isNaN(d1) && Double.isNaN(d2)) || d1 == d2

@yhuai
Copy link
Contributor

yhuai commented Jan 4, 2017

LGTM. Merging to master.

@asfgit asfgit closed this in cbd11d2 Jan 4, 2017
cmonkey pushed a commit to cmonkey/spark that referenced this pull request Jan 4, 2017
## What changes were proposed in this pull request?

In apache#16402 we made a mistake that, when double/float is infinity, the `Literal` codegen will output boxed value and cause wrong result.

This PR fixes this by special handling infinity to not output boxed value.

## How was this patch tested?

new regression test

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#16469 from cloud-fan/literal.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
## What changes were proposed in this pull request?

In apache#16402 we made a mistake that, when double/float is infinity, the `Literal` codegen will output boxed value and cause wrong result.

This PR fixes this by special handling infinity to not output boxed value.

## How was this patch tested?

new regression test

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#16469 from cloud-fan/literal.
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