spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyukjin Kwon (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-30054) Literal creation from java BigDecimal with specified target DecimalType is buggy
Date Mon, 02 Dec 2019 02:25:00 GMT

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

Hyukjin Kwon resolved SPARK-30054.
----------------------------------
    Resolution: Invalid

catalyst APIs are meant to be internal

> Literal creation from java BigDecimal with specified target DecimalType is buggy
> --------------------------------------------------------------------------------
>
>                 Key: SPARK-30054
>                 URL: https://issues.apache.org/jira/browse/SPARK-30054
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.4
>            Reporter: Mehreen Ali
>            Priority: Major
>
> Literal creation from java BigDecimal with specified target DecimalType is buggy.
> {code:java}
> scala> Literal.create(new java.math.BigDecimal("0.01"), DecimalType(26, 6))
> org.apache.spark.sql.AnalysisException: Decimal scale (2) cannot be greater than precision
(1).;
>   at org.apache.spark.sql.types.DecimalType.<init>(DecimalType.scala:46)
>   at org.apache.spark.sql.catalyst.CatalystTypeConverters$.convertToCatalyst(CatalystTypeConverters.scala:408)
>   at org.apache.spark.sql.catalyst.expressions.Literal$.create(literals.scala:155)
>   ... 51 elided
> {code}
> {code:java}
> scala> CatalystTypeConverters.convertToCatalyst(new java.math.BigDecimal("0.01"))
> org.apache.spark.sql.AnalysisException: Decimal scale (2) cannot be greater than precision
(1).;
>   at org.apache.spark.sql.types.DecimalType.<init>(DecimalType.scala:46)
>   at org.apache.spark.sql.catalyst.CatalystTypeConverters$.convertToCatalyst(CatalystTypeConverters.scala:408)
>   ... 51 elided
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message