Raviston6296 commented on PR #58945: URL: https://github.com/apache/spark/pull/58945#issuecomment-6761543266
Hi @hemanthboyina, I'm working on the same function in #60084 (SPARK-60598), so I wanted to flag the overlap so we can coordinate. Both PRs replace the `dataSchema.getFieldIndex(colName)` lookup in `ParquetUtils.getPushedDownAggResult` with a lookup by name in the file's own schema, so they change the same lines and whichever lands second will need a rebase. They also differ in one place that affects correctness: - **Top-level field index vs. column chunk index.** `fileFieldIndex` returns the column's position among the file's top-level fields, but `block.getColumns` has one chunk per *leaf* column. When a struct, array or map column comes before the aggregated column, the two indexes differ. For a file with `s struct<x:int, y:int>, a int, b int`, `a` is field 1 but its chunk is 2, so `max(a)` still reads the statistics of `s.y`, and `min(b)` reads those of `a`. This is the SPARK-60598 case. #60084 looks the chunk up among the leaves of `getSchema.getColumns` whose path has length 1, and takes the result type from the same leaf. Things this PR covers that #60084 doesn't: - the ORC side; - returning `NULL` for MIN/MAX of a column a file doesn't have. #60084 raises `PARQUET_AGGREGATE_PUSH_DOWN_UNSUPPORTED.NO_MIN_MAX` there, the same as for an all-null column today. Your behavior is the nicer one for `mergeSchema`. #60084 also stops pushing down COUNT of a nested column and turns push-down off with field-ID reading, which this PR doesn't touch. I'm happy to go whichever way the reviewers prefer. For example, #60084 could keep the Parquet chunk lookup and this PR could rebase onto it for ORC and the absent-column `NULL`, or I can rebase #60084 onto this one. cc @tdcmeehan @ulysses-you -- 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]
