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

    https://github.com/apache/spark/pull/21840#discussion_r204244400
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ---
    @@ -3858,3 +3858,29 @@ object ArrayUnion {
         new GenericArrayData(arrayBuffer)
       }
     }
    +
    +case class StructCopy(
    +    struct: Expression,
    +    fieldName: String,
    +    fieldValue: Expression) extends Expression with CodegenFallback {
    +
    +  override def children: Seq[Expression] = Seq(struct, fieldValue)
    +  override def nullable: Boolean = struct.nullable
    +
    +  lazy val fieldIndex = 
struct.dataType.asInstanceOf[StructType].fieldIndex(fieldName)
    --- End diff --
    
    If the semantics are "copy", i.e., only existing fields must be used, it 
would be nice to add a user-friendly error message here.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to