You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/21 15:22:32 UTC

[GitHub] [spark] guykhazma edited a comment on pull request #28826: [SPARK-31988][SQL] Schema pruning may discard attribute metadata

guykhazma edited a comment on pull request #28826:
URL: https://github.com/apache/spark/pull/28826#issuecomment-647140487


   @HyukjinKwon @maropu @dongjoon-hyun @viirya added a test and also another fix that was needed - the function `sortLeftFieldsByRight` also ignored the `metadata` field.
   
   As for why it happens only for v2 is because `V2ScanRelationPushDown` calls `pruneColumns` which trigger this code path (see [here](https://github.com/apache/spark/blob/d2a656c81ef784657a02e7347bfe87e4331fd2c9/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala#L50))
   While v1 calls for `prunePhysicalColumns` ([here](https://github.com/apache/spark/blob/d2a656c81ef784657a02e7347bfe87e4331fd2c9/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SchemaPruning.scala#L63) and the property `root.derivedFromAtt` is set to true so the structType from `requestedRootFields` is not used.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org