You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/06 16:22:49 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #31497: [SPARK-34385][SQL] Unwrap `SparkUpgradeException` in v2 Parquet datasource

MaxGekk commented on a change in pull request #31497:
URL: https://github.com/apache/spark/pull/31497#discussion_r571454261



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FilePartitionReader.scala
##########
@@ -72,7 +73,9 @@ class FilePartitionReader[T](readers: Iterator[PartitionedFileReader[T]])
           s"Expected: ${e.getLogicalType}, Found: ${e.getPhysicalType}"
         throw new QueryExecutionException(message, e)
       case e: ParquetDecodingException =>
-        if (e.getMessage.contains("Can not read value at")) {
+        if (e.getCause.isInstanceOf[SparkUpgradeException]) {
+          throw e.getCause

Review comment:
       In practice, this never happens since `ParquetDecodingException` always wraps an exception there https://github.com/apache/parquet-mr/blob/ee30b13bb5c3f6848c76641d3b93c9858e6746cb/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordReader.java#L253-L255




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org