You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/02/13 00:49:18 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39970: [SPARK-42401][SQL] Set `containsNull` correctly in the data type for array_insert/array_append

HyukjinKwon commented on code in PR #39970:
URL: https://github.com/apache/spark/pull/39970#discussion_r1103909400


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala:
##########
@@ -4840,7 +4840,10 @@ case class ArrayInsert(srcArrayExpr: Expression, posExpr: Expression, itemExpr:
   override def third: Expression = itemExpr
 
   override def prettyName: String = "array_insert"
-  override def dataType: DataType = first.dataType
+  override def dataType: DataType = third.nullable match {

Review Comment:
   Why don't we just do if-else :-)?



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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