Github user yijieshen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6828#discussion_r32599952
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala
 ---
    @@ -62,9 +62,14 @@ case class CreateStruct(children: Seq[NamedExpression]) 
extends Expression {
       override lazy val dataType: StructType = {
         assert(resolved,
           s"CreateStruct contains unresolvable children: 
${children.filterNot(_.resolved)}.")
    -    val fields = children.map { child =>
    -      StructField(child.name, child.dataType, child.nullable, 
child.metadata)
    -    }
    +      val fields = children.zipWithIndex.map { case (child, idx) =>
    +        child match {
    +          case ne: NamedExpression =>
    --- End diff --
    
    The `CreateStruct` here was also used by 
`org.apache.spark.sql.functions.struct` and I did this above to avoid change 
the semantic of these two `struct` method. Maybe it's better to add another two 
class to do what `GenericUDFStruct ` & `GenericUDFNamedStruct` does?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to