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 2021/04/07 00:56:51 UTC

[GitHub] [spark] maropu commented on a change in pull request #32059: [SPARK-34963][SQL] Fix nested column pruning for extracting case-insensitive struct field from array of struct

maropu commented on a change in pull request #32059:
URL: https://github.com/apache/spark/pull/32059#discussion_r608270127



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ProjectionOverSchema.scala
##########
@@ -41,9 +43,10 @@ case class ProjectionOverSchema(schema: StructType) {
       case a: GetArrayStructFields =>
         getProjection(a.child).map(p => (p, p.dataType)).map {
           case (projection, ArrayType(projSchema @ StructType(_), _)) =>
+            val selectedField = projSchema.find(f => resolver(f.name, a.field.name)).get

Review comment:
       This issue can occur only in an array of structs? The code at line 66 (@dongjoon-hyun pointed out above) has the same pattern `projSchema.fieldIndex(field.name)`, so I'm worried that is can occur in other cases.




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