LuciferYang commented on code in PR #40563: URL: https://github.com/apache/spark/pull/40563#discussion_r1150115729
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala: ########## @@ -5056,128 +4956,45 @@ case class ArrayCompact(child: Expression) """, since = "3.4.0", group = "array_funcs") -case class ArrayAppend(left: Expression, right: Expression) - extends BinaryExpression - with ImplicitCastInputTypes - with ComplexTypeMergingExpression - with QueryErrorsBase { - override def prettyName: String = "array_append" +case class ArrayAppend(arr: Expression, ele: Expression) extends InsertArrayOneSide { - @transient protected lazy val elementType: DataType = - inputTypes.head.asInstanceOf[ArrayType].elementType + override lazy val replacement: Expression = + ArrayInsert(arr, Add(ArraySize(left), Literal(1)), ele) Review Comment: use both `arr` and `left`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org