File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/types Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,10 @@ final class Decimal extends Ordered[Decimal] with Serializable {
132132 }
133133
134134 /**
135- * Set this Decimal to the given BigInteger value. Will have precision 38 and scale 0.
135+ * Set this Decimal to the given BigInteger value. Will have precision 38 and scale 0
136+ * if value is fit into long value range. Otherwise, use BigDecimal
137+ *
138+ * This code avoids BigDecimal object allocation as possible to improve runtime efficiency
136139 */
137140 def set (bigintval : BigInteger ): Decimal = {
138141 try {
@@ -144,7 +147,6 @@ final class Decimal extends Ordered[Decimal] with Serializable {
144147 } catch {
145148 case _ : ArithmeticException =>
146149 set(BigDecimal (bigintval))
147- this
148150 }
149151 }
150152
You can’t perform that action at this time.
0 commit comments