Yaohua628 commented on a change in pull request #34575:
URL: https://github.com/apache/spark/pull/34575#discussion_r772754324
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SchemaPruning.scala
##########
@@ -164,7 +164,12 @@ object SchemaPruning extends Rule[LogicalPlan] {
outputRelation: LogicalRelation,
prunedBaseRelation: HadoopFsRelation) = {
val prunedOutput = getPrunedOutput(outputRelation.output,
prunedBaseRelation.schema)
- outputRelation.copy(relation = prunedBaseRelation, output = prunedOutput)
+ // also add the metadata output if any
+ // TODO: should be able to prune the metadata schema
Review comment:
actually no:
1. this rule supports only: `Parquet` + `ORC` and controls by a flag
`spark.sql.optimizer.nestedSchemaPruning.enabled`
2. this rule only prunes the data schema (comparing the data schema with the
project + filter)
I am thinking:
- refactor this rule to prune metadata
OR
- make a new rule `MetadataSchemaPruning`
OR
- prune the metadata at `FileSourceStrategy` (might be hacky)
WDYT? thanks!
--
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]