GitHub user dongjoon-hyun opened a pull request: https://github.com/apache/spark/pull/14353
[SPARK-16714][SQL] `array` should create a decimal array from decimals with different precisions and scales ## What changes were proposed in this pull request? In Spark 2.0, we will parse float literals as decimals. However, it introduces a side-effect, which is described below. ```scala scala> select array(0.001, 0.02) 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 ``` ## How was this patch tested? Pass the Jenkins tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/dongjoon-hyun/spark SPARK-16714 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/14353.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14353 ---- commit d3dd7fb03c7bd96d7ce1ab7ed505d137775062f2 Author: Dongjoon Hyun <dongj...@apache.org> Date: 2016-07-25T22:36:43Z [SPARK-16714][SQL] Fail to create a decimal arrays with literals having different inferred precessions and scales ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org