AngersZhuuuu commented on a change in pull request #34077:
URL: https://github.com/apache/spark/pull/34077#discussion_r715461117



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/util/SQLOpenHashSet.scala
##########
@@ -60,6 +61,57 @@ class SQLOpenHashSet[@specialized(Long, Int, Double, Float) 
T: ClassTag](
 }
 
 object SQLOpenHashSet {
+  def withNullCheckFunc(
+      dataType: DataType,
+      hashSet: SQLOpenHashSet[Any],
+      handleNotNull: Any => Unit,
+      handleNull: () => Unit): ArrayData => Int => Unit = {
+    (array: ArrayData) => {
+      (index: Int) =>
+        if (array.isNullAt(index)) {
+          if (!hashSet.containsNull) {
+            hashSet.addNull
+            handleNull()
+          }
+        } else {
+          val elem = array.get(index, dataType)
+          handleNotNull(elem)
+        }
+    }
+  }
+
+  def withNullCheckCode(
+      arrayType1: DataType,
+      arrayType2: DataType,
+      hashSet: String,
+      handleNotNull: String => String => String,
+      handleNull: String): String => String => String = {

Review comment:
       Changed




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