szehon-ho commented on code in PR #53360:
URL: https://github.com/apache/spark/pull/53360#discussion_r2613079515
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AssignmentUtils.scala:
##########
@@ -204,14 +228,71 @@ object AssignmentUtils extends SQLConfHelper with
CastSupport {
}
val updatedFieldExprs = fieldAttrs.zip(fieldExprs).map { case
(fieldAttr, fieldExpr) =>
applyAssignments(fieldAttr, fieldExpr, assignments, addError,
colPath :+ fieldAttr.name,
- coerceNestedTypes)
+ coerceNestedTyptes)
+ }
+ toNamedStruct(structType, updatedFieldExprs)
+
+ case otherType =>
+ addError(
+ "Updating nested fields is only supported for StructType but " +
+ s"'${colPath.quoted}' is of type $otherType")
+ colExpr
+ }
+ }
+
+ private def applyNestedFieldAssignments(
Review Comment:
note: this is like applyFieldAssignment above, but recurses to all nested
fields
--
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]