Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,22 @@ private[parquet] class ParquetRowConverter(
updater: ParentContainerUpdater): Converter with HasParentContainerUpdater = {

catalystType match {
case BooleanType | IntegerType | LongType | FloatType | DoubleType | BinaryType =>
case BooleanType | IntegerType | FloatType | DoubleType | BinaryType =>
new ParquetPrimitiveConverter(updater)

/**
* [SPARK-17477] When reading a hive table of parquet files with schema evolution
* from Int to Long and if hive metastore has Long as its type while parquet files
* have Int, SparkSQL need to figure out the actual type in the parquet files.
* Otherwise, it will result in java.lang.ClassCastException: [[MutableLong]] cannot
* be cast to [[MutableInt]].
*/
case LongType =>
new ParquetPrimitiveConverter(updater) {
override def addInt(value: Int): Unit =
updater.setLong(value.asInstanceOf[Long])
}

case ByteType =>
new ParquetPrimitiveConverter(updater) {
override def addInt(value: Int): Unit =
Expand Down