tdcmeehan commented on code in PR #58945:
URL: https://github.com/apache/spark/pull/58945#discussion_r4067826480
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetUtils.scala:
##########
@@ -323,54 +326,62 @@ object ParquetUtils extends Logging {
private[sql] def getPushedDownAggResult(
footer: ParquetMetadata,
filePath: String,
- dataSchema: StructType,
partitionSchema: StructType,
- aggregation: Aggregation)
+ aggregation: Aggregation,
+ aggSchema: StructType)
: (Array[PrimitiveType], Array[Any]) = {
val footerFileMetaData = footer.getFileMetaData
- val fields = footerFileMetaData.getSchema.getFields
+ // Resolve by name in the file's own schema; a positional lookup breaks
under mergeSchema.
+ val fileSchema = footerFileMetaData.getSchema
+ def fileFieldIndex(colName: String): Int =
+ if (fileSchema.containsField(colName)) fileSchema.getFieldIndex(colName)
else -1
Review Comment:
It seems we don't check case sensitivity here. If so, I believe we need to
pass down that flag, [same as the ORC
reader](https://github.com/apache/spark/pull/58945/changes#diff-e14fd8725cf71eee7b34fa299c2f3abe5a0033f9abce9de4c7e081ba57991b0bR589).
--
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]