Github user MaxGekk commented on a diff in the pull request: https://github.com/apache/spark/pull/21840#discussion_r204249828 --- 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) + + override def dataType: DataType = { + val structType = struct.dataType.asInstanceOf[StructType] --- End diff -- Sure, I will do that. This is just a proof of concept.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org