Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed May 26, 2020
1 parent 7eeea97 commit 8e1e0a2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ case object NamePlaceholder extends LeafExpression with Unevaluable {
*/
object CreateStruct {
/**
* Returns a named struct with generating names or using the names when available.
* Returns a named struct with generated names or using the names when available.
* It should not be used for `struct` expressions or functions explicitly called
* by users.
*/
Expand Down Expand Up @@ -449,6 +449,9 @@ case class CreateNamedStruct(children: Seq[Expression]) extends Expression {
""".stripMargin, isNull = FalseLiteral)
}

// There is an alias set at `CreateStruct.create`. If there is an alias,
// this is the struct function explicitly called by a user and we should
// respect it in the SQL string as `struct(...)`.
override def prettyName: String = getTagValue(FUNC_ALIAS).getOrElse("named_struct")

override def sql: String = getTagValue(FUNC_ALIAS).map { alias =>
Expand Down

0 comments on commit 8e1e0a2

Please sign in to comment.