viirya commented on a change in pull request #32059:
URL: https://github.com/apache/spark/pull/32059#discussion_r608277894
##########
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:
Oh it is fine. `ExtractValue` actually does column name resolving
correctly. The difference is how `ProjectionOverSchema` treats
`GetArrayStructFields` and `GetStructField` there.
That's also said we may not need to do resolving again in
`ProjectionOverSchema`, as this PR currently do. We can just use
`GetArrayStructFields.ordinal` which already points to correct field in child
expression.
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]