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] [Commented] (SPARK-16714) Fail to create a decimal arrays with literals having different inferred precessions and scales
Date Thu, 28 Jul 2016 07:38:20 GMT

    [ https://issues.apache.org/jira/browse/SPARK-16714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15397186#comment-15397186
] 

Apache Spark commented on SPARK-16714:
--------------------------------------

User 'petermaxlee' has created a pull request for this issue:
https://github.com/apache/spark/pull/14389

> Fail to create a decimal arrays with literals having different inferred precessions and
scales
> ----------------------------------------------------------------------------------------------
>
>                 Key: SPARK-16714
>                 URL: https://issues.apache.org/jira/browse/SPARK-16714
>             Project: Spark
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Yin Huai
>
> In Spark 2.0, we will parse float literals as decimals. However, it introduces a side-effect,
which is described below. 
>  
> {code}
> select array(0.001, 0.02)
> {code}
> causes
> {code}
> org.apache.spark.sql.AnalysisException: cannot resolve 'array(CAST(0.001 AS DECIMAL(3,3)),
CAST(0.02 AS DECIMAL(2,2)))' due to data type mismatch: input to function array should all
be the same type, but it's [decimal(3,3), decimal(2,2)]; line 1 pos 7
> {code}



--
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