Skip to content

Commit 323d1d2

Browse files
committed
Modify RowWriteSupport to use the exact types to cast.
1 parent 9d5ecf8 commit 323d1d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTableSupport.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ private[parquet] class RowWriteSupport extends WriteSupport[Row] with Logging {
192192
)
193193
)
194194
case IntegerType => writer.addInteger(value.asInstanceOf[Int])
195-
case ShortType => writer.addInteger(value.asInstanceOf[Int])
195+
case ShortType => writer.addInteger(value.asInstanceOf[Short])
196196
case LongType => writer.addLong(value.asInstanceOf[Long])
197-
case ByteType => writer.addInteger(value.asInstanceOf[Int])
197+
case ByteType => writer.addInteger(value.asInstanceOf[Byte])
198198
case DoubleType => writer.addDouble(value.asInstanceOf[Double])
199199
case FloatType => writer.addFloat(value.asInstanceOf[Float])
200200
case BooleanType => writer.addBoolean(value.asInstanceOf[Boolean])

0 commit comments

Comments
 (0)