AngersZhuuuu commented on pull request #34337:
URL: https://github.com/apache/spark/pull/34337#issuecomment-947366565


   > It would be great if we can have this exception handling in 
`FileScanRDD.scala`. I believe we can use `currentFile.filePath` instead of 
introducing another string variable to ORC/Parquet file format seperately. 
Could you try that way, @AngersZhuuuu ?
   > 
   > ```scala
   >           try {
   >             hasNext
   >           } catch {
   >             case e: SchemaColumnConvertNotSupportedException =>
   >               throw 
QueryExecutionErrors.unsupportedSchemaColumnConvertError(
   >                 currentFile.filePath, e.getColumn, e.getLogicalType, 
e.getPhysicalType, e)
   >             case e: ParquetDecodingException =>
   >               if (e.getCause.isInstanceOf[SparkUpgradeException]) {
   >                 throw e.getCause
   >               } else if (e.getMessage.contains("Can not read value at")) {
   >                 throw QueryExecutionErrors.cannotReadParquetFilesError(e)
   >               }
   >               throw e
   >           }
   > ```
   
   Nice suggestion, here may be more better, will try this way


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

Reply via email to