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

    https://github.com/apache/spark/pull/21770#discussion_r202547003
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ---
    @@ -3758,7 +3758,14 @@ case class ArrayUnion(left: Expression, right: 
Expression) extends ArraySetLike
           } else {
             val arrayUnion = classOf[ArrayUnion].getName
             val et = ctx.addReferenceObj("elementTypeUnion", elementType)
    -        val order = ctx.addReferenceObj("orderingUnion", ordering)
    +        // Some data types (e.g., `BinaryType`) have anonymous classes for 
ordering and
    +        // `addReferenceObj` generates code below for anonymous classes;
    +        //
    +        //   (org.apache.spark.sql.types.BinaryType$$anon$1) references[0];
    +        //
    +        // Janino can compile this statement, but JDK Java compilers 
can't. So, we explicitly
    +        // set `className` here.
    +        val order = ctx.addReferenceObj("orderingUnion", ordering, 
"scala.math.Ordering<Object>")
    --- End diff --
    
    @mgaido91 I a little misunderstood, so I updated the comment. I don't know 
why this fails in JDK compilers now, so I think I need to dig into this more. 
cc: @rednaxelafx


---

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

Reply via email to