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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
##########
@@ -546,7 +547,8 @@ case class StringToMap(text: Expression, pairDelim: 
Expression, keyValueDelim: E
 case class WithFields(
     structExpr: Expression,
     names: Seq[String],
-    valExprs: Seq[Expression]) extends Unevaluable {
+    valExprs: Seq[Expression],
+    sortColumns: Boolean = false) extends Unevaluable {

Review comment:
       I thought this param is not related to the `withField` operation, so I 
left the comment. But, either is okay.
   ```
   scala> val df = sql("SELECT named_struct('a', 1, 'b', 2) struct_col")
   scala> df.select($"struct_col".withField("c", lit(3))).explain(true)
   == Analyzed Logical Plan ==
   with_fields(struct_col, 3): struct<a:int,b:int,c:int>
   Project [with_fields(struct_col#0, c, 3, false) AS with_fields(struct_col, 
3)#4]
                                            ^^^^^
   +- Project [named_struct(a, 1, b, 2) AS struct_col#0]
      +- OneRowRelation
   ```




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