liuyongvs commented on code in PR #3233:
URL: https://github.com/apache/calcite/pull/3233#discussion_r1210184642


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -3869,6 +3869,17 @@ private static AtomicLong getAtomicLong(String key) {
     return atomic;
   }
 
+  /** Support the ARRAY_COMPACT function. */
+  public static List removeNulls(List list) {
+    List result = new ArrayList();
+    for (int i = 0; i < list.size(); i++) {
+      if (list.get(i) != null) {
+        result.add(list.get(i));
+      }
+    }
+    return result;
+  }
+
   /** Support the ARRAY_DISTINCT function. */

Review Comment:
   the reason why i don't use this because
   1) the spark array(null) throw exception 
java.lang.UnsupportedOperationException: remove
       because the spark array implementation using Arrays.asList(); which make 
the exception happends
   2) the standard array[null] pass
   ```
   list.removeIf(Objects::isNull);
   ```



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

Reply via email to