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

    https://github.com/apache/spark/pull/15718#discussion_r86322684
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
 ---
    @@ -172,110 +174,80 @@ case class CreateMap(children: Seq[Expression]) 
extends Expression {
     }
     
     /**
    - * Returns a Row containing the evaluation of all children expressions.
    + * An expression representing a not yet available attribute name. This 
expression is unevaluable
    + * and as its name suggests it is a temporary place holder until we're 
able to determine the
    + * actual attribute name.
      */
    -@ExpressionDescription(
    -  usage = "_FUNC_(col1, col2, col3, ...) - Creates a struct with the given 
field values.")
    -case class CreateStruct(children: Seq[Expression]) extends Expression {
    -
    -  override def foldable: Boolean = children.forall(_.foldable)
    -
    -  override lazy val dataType: StructType = {
    -    val fields = children.zipWithIndex.map { case (child, idx) =>
    -      child match {
    -        case ne: NamedExpression =>
    -          StructField(ne.name, ne.dataType, ne.nullable, ne.metadata)
    -        case _ =>
    -          StructField(s"col${idx + 1}", child.dataType, child.nullable, 
Metadata.empty)
    -      }
    -    }
    -    StructType(fields)
    -  }
    -
    +case object NamePlaceholder extends LeafExpression with Unevaluable {
    --- End diff --
    
    Yeah, I was thinking the same thing at first and I tried a few things. 
However this was the most straightforward way of getting it to work.


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