Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 11:51 AM
Hi @Boyeenas ,
I believe your assumption is correct. Databricks is built on Apache Spark and the system applies rounding automatically based on the value of the subsequent digit. In your case, if the original value had a 7th decimal digit of 5 or higher, Spark’s default half-up rounding will round the 6th decimal place up resulting in 0.033883 instead of 0.033882.
From this documentation https://spark.apache.org/docs/3.5.3/sql-ref-datatypes.html , Spark’s DecimalType is based on Java’s BigDecimal.
Additional References:
https://spark.apache.org/docs/3.5.1/api/java/org/apache/spark/sql/types/DecimalType.html
Hope this helps!