viirya commented on a change in pull request #31758:
URL: https://github.com/apache/spark/pull/31758#discussion_r592122159



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -3975,8 +3964,15 @@ object ResolveCreateNamedStruct extends 
Rule[LogicalPlan] {
   override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveExpressions 
{
     case e: CreateNamedStruct if !e.resolved =>
       val children = e.children.grouped(2).flatMap {
-        case Seq(NamePlaceholder, e: NamedExpression) if e.resolved =>
-          Seq(Literal(e.name), e)
+        case Seq(NamePlaceholder, ne: NamedExpression) if ne.resolved =>
+          Seq(Literal(ne.name), ne)
+        case Seq(NamePlaceholder, g @ GetStructField(child, _, Some(name))) if 
child.resolved =>

Review comment:
       Only `GetStructField`, `GetArrayStructFields` and `GetMapValue` are the 
possible expressions here?
   
   Can it be `case Seq(NamePlaceholder, other 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]

Reply via email to