LiShuMing opened a new pull request #25446: [SPARK-28724] [SQL] Throw error message when cast out range decimal to long URL: https://github.com/apache/spark/pull/25446 Maybe this is a bug in `Scala` when convert `BigDecimal` to `Long`, however Spark should keep the result correct when query the sqls below: ``` spark-sql> select cast(20190801002382000052000000017638 as int); -1493203738 spark-sql> select cast(20190801002382000052000000017638 as bigint); 4671677505944388838 ``` After this patch, the result will throw AnalysisException : ``` spark-sql> select cast(20190801002382000052000000017638 as bigint); Error in query: Decimal 20190801002382000052000000017638 does not fit in range [-9223372036854775808, 9223372036854775807] for type Long; ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org