cloud-fan commented on a change in pull request #28633:
URL: https://github.com/apache/spark/pull/28633#discussion_r429976218



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
##########
@@ -311,7 +311,12 @@ case object NamePlaceholder extends LeafExpression with 
Unevaluable {
 /**
  * Returns a Row containing the evaluation of all children expressions.
  */
-object CreateStruct extends FunctionBuilder {
+object CreateStruct {
+  /**
+   * Returns a named struct with generating names or using the names when 
available.

Review comment:
       `generating names` -> `generated names `

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
##########
@@ -433,7 +449,12 @@ case class CreateNamedStruct(children: Seq[Expression]) 
extends Expression {
        """.stripMargin, isNull = FalseLiteral)
   }
 
-  override def prettyName: String = "named_struct"
+  override def prettyName: String = 
getTagValue(FUNC_ALIAS).getOrElse("named_struct")
+
+  override def sql: String = getTagValue(FUNC_ALIAS).map { alias =>

Review comment:
       maybe better to leave a comment here and refer to `CreateStruct.create`: 
if there is an alias, it means this is the `struct` function and we should skip 
the auto-generated alias names in the SQL string.




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