You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/29 19:38:59 UTC

[GitHub] [spark] viirya commented on a change in pull request #30243: [SPARK-33335][SQL] Support `array_contains_array` func

viirya commented on a change in pull request #30243:
URL: https://github.com/apache/spark/pull/30243#discussion_r532255830



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -3957,3 +3957,198 @@ case class ArrayExcept(left: Expression, right: Expression) extends ArrayBinaryL
 
   override def prettyName: String = "array_except"
 }
+
+/**
+ * Checks if the array (left) has the array (right)
+ */
+@ExpressionDescription(
+  usage = "_FUNC_(array1, array2) - Returns true if the array1 contains the array2.",

Review comment:
       This `array_contains_array` is not the same like others, for example the presto's https://github.com/prestosql/presto/pull/5593.
   
   Looks at the implementation here,  this `array_contains_array` treats array as set and check if the intersect of two sets is the same as the first set.
   
   I'm not sure if there is a good definition for array contains array? For example, how we treat element order? duplicates?
   
   It is not good if we need to fix these issues in the future for this function and add legacy configs for behavior change. It is better to define the function clearly when we add an expression.
   




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

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