Skip to content

Commit 2006613

Browse files
committed
Fix type for "unsigned bigint" jdbc loading.
The original fix uses DecimalType.Unlimited, which is harder to handle afterwards. There is no scale and most data should fit into a long, thus DecimalType(20,0) should be better.
1 parent 4aed66f commit 2006613

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private[sql] object JDBCRDD extends Logging {
5555
val answer = sqlType match {
5656
// scalastyle:off
5757
case java.sql.Types.ARRAY => null
58-
case java.sql.Types.BIGINT => if (signed) { LongType } else { DecimalType.Unlimited }
58+
case java.sql.Types.BIGINT => if (signed) { LongType } else { DecimalType(20,0) }
5959
case java.sql.Types.BINARY => BinaryType
6060
case java.sql.Types.BIT => BooleanType // @see JdbcDialect for quirks
6161
case java.sql.Types.BLOB => BinaryType

0 commit comments

Comments
 (0)