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

    https://github.com/apache/spark/pull/21103#discussion_r205930539
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ---
    @@ -3968,3 +3964,242 @@ object ArrayUnion {
         new GenericArrayData(arrayBuffer)
       }
     }
    +
    +/**
    + * Returns an array of the elements in the intersect of x and y, without 
duplicates
    + */
    +@ExpressionDescription(
    +  usage = """
    +  _FUNC_(array1, array2) - Returns an array of the elements in array1 but 
not in array2,
    +    without duplicates.
    +  """,
    +  examples = """
    +    Examples:
    +      > SELECT _FUNC_(array(1, 2, 3), array(1, 3, 5));
    +       array(2)
    +  """,
    +  since = "2.4.0")
    +case class ArrayExcept(left: Expression, right: Expression) extends 
ArraySetLike
    +    with ComplexTypeMergingExpression {
    +  override def dataType: DataType = {
    +    dataTypeCheck
    +    left.dataType
    +  }
    +
    +  @transient lazy val evalExcept: (ArrayData, ArrayData) => ArrayData = {
    +    if (elementTypeSupportEquals) {
    +      (array1, array2) =>
    +        val hs = new OpenHashSet[Any]
    --- End diff --
    
    Yeah, to use `byte[]` for binary type looks awkward and inefficient. It 
would be good to introduce a new class for binary type like `UTF8String`.
    
    On the other hand, it is not a task for Spark 2.4 due to a lot of changes.


---

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

Reply via email to