uros-b commented on code in PR #58496:
URL: https://github.com/apache/spark/pull/58496#discussion_r3955952206
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala:
##########
@@ -421,12 +432,26 @@ private[parquet] class ParquetRowConverter(
}
case t: DecimalType =>
- throw
QueryExecutionErrors.cannotCreateParquetConverterForDecimalTypeError(
- t, parquetType.toString)
+ parquetType.asPrimitiveType().getPrimitiveTypeName match {
+ case INT32 | INT64 =>
+ throw new SchemaColumnConvertNotSupportedException(
+ parquetType.getName,
+ parquetType.asPrimitiveType().getPrimitiveTypeName.toString,
+ t.catalogString)
+ case _ =>
+ throw
QueryExecutionErrors.cannotCreateParquetConverterForDecimalTypeError(
+ t, parquetType.toString)
+ }
- case _: StringType =>
+ case _: StringType if parquetType.asPrimitiveType().getPrimitiveTypeName
== BINARY =>
Review Comment:
Please guard StringType with parquetType.isPrimitive before
asPrimitiveType(), and consider formatting the column the same way as
ParquetVectorUpdaterFactory ([name]) so both readers produce the same
FAILED_READ_FILE.PARQUET_COLUMN_DATA_TYPE_MISMATCH parameters.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]