MaxGekk commented on code in PR #41486:
URL: https://github.com/apache/spark/pull/41486#discussion_r1246177256


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/datasketchesAggregates.scala:
##########
@@ -314,13 +308,18 @@ case class HllUnionAgg(
     if (v != null) {
       left.dataType match {
         case BinaryType =>
-          val sketch = HllSketch.wrap(Memory.wrap(v.asInstanceOf[Array[Byte]]))
-          val union = unionOption.getOrElse(new Union(sketch.getLgConfigK))
-          compareLgConfigK(union.getLgConfigK, sketch.getLgConfigK)
-          union.update(sketch)
-          Some(union)
-        case _ => throw new UnsupportedOperationException(
-          s"A Union instance can only be updated with a valid HllSketch byte 
array")
+          try {
+            val sketch = 
HllSketch.wrap(Memory.wrap(v.asInstanceOf[Array[Byte]]))
+            val union = unionOption.getOrElse(new Union(sketch.getLgConfigK))
+            compareLgConfigK(union.getLgConfigK, sketch.getLgConfigK)
+            union.update(sketch)
+            Some(union)
+          } catch {
+            case _: java.lang.Error =>

Review Comment:
   Could you explain, please, why do you catch `java.lang.Error`, just wonder.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to