sam-1112 commented on code in PR #7820:
URL: https://github.com/apache/datafusion-comet/pull/7820#discussion_r4780266650
##########
spark/src/main/spark-4.x/org/apache/spark/sql/comet/shims/ShimSparkErrorConverter.scala:
##########
@@ -374,6 +375,23 @@ trait ShimSparkErrorConverter {
val filePath = params.get("filePath").map(_.toString).getOrElse("")
Some(QueryExecutionErrors.cannotReadFilesError(dupCause, filePath))
+ case "ParquetFieldRequestedMoreThanOnce" =>
+ // Mirror Spark's
`ParquetReadSupport.checkNoFieldRequestedMoreThanOnce` (SPARK-60262).
+ // The native reader raises this only for a Spark that has it, but
+ // `QueryExecutionErrors.parquetFieldRequestedMoreThanOnceError` is
not on the Spark
+ // versions Comet compiles against, so build the same
SparkRuntimeException from its
+ // error class. Wrap it in FAILED_READ_FILE.NO_HINT like the other
Parquet read errors
+ // here, as Spark's file scan does at the task boundary. The
SparkRuntimeException stays
+ // as `getCause`.
+ val requestedCause = new SparkRuntimeException(
+ errorClass = "PARQUET_FIELD_REQUESTED_MORE_THAN_ONCE",
+ messageParameters = Map(
+ "requestedFields" -> params("requestedFields").toString,
+ "parquetField" -> params("parquetField").toString,
+ "fieldIdReadConf" -> ("\"" +
SQLConf.PARQUET_FIELD_ID_READ_ENABLED.key + "\"")))
+ val requestedPath =
params.get("filePath").map(_.toString).getOrElse("")
Review Comment:
Could we carry the failing file’s path with this error? The Rust payload
currently contains only `requestedFields` and `parquetField`, so
`requestedPath` is always empty on the native error path. This leaves
`FAILED_READ_FILE.NO_HINT` without the filename, which makes a multi-file scan
failure difficult to diagnose.
The converter test supplies `filePath` manually, so it does not exercise
this gap. Could we add a reader test with multiple files that checks the outer
error identifies the failing file?
--
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]