spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (SPARK-13772) DataType mismatch about decimal
Date Wed, 09 Mar 2016 13:06:40 GMT

     [ https://issues.apache.org/jira/browse/SPARK-13772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Apache Spark reassigned SPARK-13772:
------------------------------------

    Assignee:     (was: Apache Spark)

> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message