Skip to content

Conversation

@cenyuhai
Copy link
Contributor

@cenyuhai cenyuhai commented Mar 9, 2016

fix data type mismatch for decimal, patch for branch 1.6

test("test for SPARK-13772") {
val rule = HiveTypeCoercion.IfCoercion
ruleTest(rule,
If(Literal(true), Literal(1.0), Cast(Literal(1.0), DecimalType(19, 0))),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also check it with other database systems like Hive? Do they allow double type and decimal type in if and else branches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cloud-fan It is ok in hive 1.2.1 and spark 1.4.1.
test case:
select if(1=1, cast(1 as double), cast(1 as decimal)) from test

@liancheng
Copy link
Contributor

ok to test

@liancheng
Copy link
Contributor

add to whitelist

@SparkQA
Copy link

SparkQA commented Mar 17, 2016

Test build #53421 has finished for PR 11605 at commit 42addd6.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Mar 17, 2016

Test build #53422 has finished for PR 11605 at commit 90cf309.

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

@liancheng
Copy link
Contributor

LGTM. Thanks for fixing this! Merging to branch-1.6.

asfgit pushed a commit that referenced this pull request Mar 22, 2016
Fix data type mismatch for decimal, patch for branch-1.6.

Author: cenyuhai <[email protected]>

Closes #11605 from cenyuhai/SPARK-13772.
@liancheng
Copy link
Contributor

BTW, next time please use the format like [SPARK-13772][SQL] <Title> in PR title. For this one, I've manually updated the commit message while merging.

@cenyuhai cenyuhai changed the title [Spark-13772] fix data type mismatch for decimal [Spark-13772][SQL] fix data type mismatch for decimal Mar 22, 2016
@dongjoon-hyun
Copy link
Member

Hi, @cenyuhai .
If you don't mind, could you close this PR? It's already merged.
Currently, only PRs for master branch seems to close automatically.

@cenyuhai cenyuhai closed this Apr 16, 2016
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