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-20291][SQL][BACKPORT] NaNvl(FloatType, NullType) should not be cast to N… #17618

Closed
wants to merge 3 commits into from

Conversation

dbtsai
Copy link
Member

@dbtsai dbtsai commented Apr 12, 2017

…aNvl(DoubleType, DoubleType)

What changes were proposed in this pull request?

This is a backport of #17606

NaNvl(float value, null) will be converted into NaNvl(float value, Cast(null, DoubleType)) and finally NaNvl(Cast(float value, DoubleType), Cast(null, DoubleType)).

This will cause mismatching in the output type when the input type is float.

By adding extra rule in TypeCoercion can resolve this issue.

How was this patch tested?

unite tests.

Please review http://spark.apache.org/contributing.html before opening a pull request.

@SparkQA
Copy link

SparkQA commented Apr 12, 2017

Test build #75731 has started for PR 17618 at commit f060172.

@viirya
Copy link
Member

viirya commented Apr 12, 2017

Shall we add backport tag to the title?

@SparkQA
Copy link

SparkQA commented Apr 12, 2017

Test build #75732 has started for PR 17618 at commit a50c2e7.

@dbtsai dbtsai changed the title [SPARK-20291][SQL] NaNvl(FloatType, NullType) should not be cast to N… [SPARK-20291][SQL][BACKPORT] NaNvl(FloatType, NullType) should not be cast to N… Apr 12, 2017
@dbtsai
Copy link
Member Author

dbtsai commented Apr 12, 2017

@viirya Added. Thanks.

@gatorsmile
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Apr 12, 2017

Test build #75734 has finished for PR 17618 at commit a50c2e7.

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

asfgit pushed a commit that referenced this pull request Apr 12, 2017
… cast to N…

…aNvl(DoubleType, DoubleType)

## What changes were proposed in this pull request?

This is a backport of #17606

`NaNvl(float value, null)` will be converted into `NaNvl(float value, Cast(null, DoubleType))` and finally `NaNvl(Cast(float value, DoubleType), Cast(null, DoubleType))`.

This will cause mismatching in the output type when the input type is float.

By adding extra rule in TypeCoercion can resolve this issue.

## How was this patch tested?

unite tests.

Please review http://spark.apache.org/contributing.html before opening a pull request.

Author: DB Tsai <dbt@netflix.com>
Author: DB Tsai <dbtsai@dbtsai.com>

Closes #17618 from dbtsai/branch-2.0.
Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

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

Thanks! Merging to 2.0.

Could you close it?

@dbtsai
Copy link
Member Author

dbtsai commented Apr 12, 2017

Thanks.

@dbtsai dbtsai closed this Apr 12, 2017
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