Skip to content

Commit b26412e

Browse files
committed
address comments
1 parent b1527b7 commit b26412e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ object JavaTypeInference {
8989
case c: Class[_] if c == classOf[java.lang.Boolean] => (BooleanType, true)
9090

9191
case c: Class[_] if c == classOf[java.math.BigDecimal] => (DecimalType.SYSTEM_DEFAULT, true)
92-
case c: Class[_] if c == classOf[java.math.BigInteger] => (DecimalType.BIGINT_DEFAULT, true)
92+
case c: Class[_] if c == classOf[java.math.BigInteger] => (DecimalType.BigIntDecimal, true)
9393
case c: Class[_] if c == classOf[java.sql.Date] => (DateType, true)
9494
case c: Class[_] if c == classOf[java.sql.Timestamp] => (TimestampType, true)
9595

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,14 @@ object ScalaReflection extends ScalaReflection {
601601
case t if t <:< localTypeOf[java.math.BigInteger] =>
602602
StaticInvoke(
603603
Decimal.getClass,
604-
DecimalType.BIGINT_DEFAULT,
604+
DecimalType.BigIntDecimal,
605605
"apply",
606606
inputObject :: Nil)
607607

608608
case t if t <:< localTypeOf[scala.math.BigInt] =>
609609
StaticInvoke(
610610
Decimal.getClass,
611-
DecimalType.BIGINT_DEFAULT,
611+
DecimalType.BigIntDecimal,
612612
"apply",
613613
inputObject :: Nil)
614614

@@ -757,9 +757,9 @@ object ScalaReflection extends ScalaReflection {
757757
case t if t <:< localTypeOf[java.math.BigDecimal] =>
758758
Schema(DecimalType.SYSTEM_DEFAULT, nullable = true)
759759
case t if t <:< localTypeOf[java.math.BigInteger] =>
760-
Schema(DecimalType.BIGINT_DEFAULT, nullable = true)
760+
Schema(DecimalType.BigIntDecimal, nullable = true)
761761
case t if t <:< localTypeOf[scala.math.BigInt] =>
762-
Schema(DecimalType.BIGINT_DEFAULT, nullable = true)
762+
Schema(DecimalType.BigIntDecimal, nullable = true)
763763
case t if t <:< localTypeOf[Decimal] => Schema(DecimalType.SYSTEM_DEFAULT, nullable = true)
764764
case t if t <:< localTypeOf[java.lang.Integer] => Schema(IntegerType, nullable = true)
765765
case t if t <:< localTypeOf[java.lang.Long] => Schema(LongType, nullable = true)

sql/catalyst/src/main/scala/org/apache/spark/sql/types/DecimalType.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ object DecimalType extends AbstractDataType {
118118
private[sql] val LongDecimal = DecimalType(20, 0)
119119
private[sql] val FloatDecimal = DecimalType(14, 7)
120120
private[sql] val DoubleDecimal = DecimalType(30, 15)
121+
private[sql] val BigIntDecimal = DecimalType(38, 0)
121122

122123
private[sql] def forType(dataType: DataType): DecimalType = dataType match {
123124
case ByteType => ByteDecimal

0 commit comments

Comments
 (0)