[
https://issues.apache.org/jira/browse/SPARK-13772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15187065#comment-15187065
]
Apache Spark commented on SPARK-13772:
--------------------------------------
User 'cenyuhai' has created a pull request for this issue:
https://github.com/apache/spark/pull/11605
> DataType mismatch about decimal
> -------------------------------
>
> Key: SPARK-13772
> URL: https://issues.apache.org/jira/browse/SPARK-13772
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.6.0
> Environment: spark1.6.0 hadoop2.2.0 jdk1.7.0_79
> Reporter: cen yuhai
>
> I found a bug:
> select if(1=1, cast(1 as double), cast(1.1 as decimal) as a from test
> It will throw exceptions like this:
> Error in query: cannot resolve 'if ((1 = 1)) cast(1 as double) else cast(1.1
> as decimal(10,0))' due to data type mismatch: differing types in 'if ((1 =
> 1)) cast(1 as double) else cast(1.1 as decimal(10,0))' (double and
> decimal(10,0)).; line 1 pos 37
> I also test:
> select if(1=1,cast(1 as decimal),cast(1 as decimal(19,6))) from test;
> Error in query: cannot resolve 'if ((1 = 1)) cast(1 as decimal(10,0)) else
> cast(1 as decimal(19,6))' due to data type mismatch: differing types in 'if
> ((1 = 1)) cast(1 as decimal(10,0)) else cast(1 as decimal(19,6))'
> (decimal(10,0) and decimal(19,6)).; line 1 pos 38
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]