You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/01 12:10:15 UTC

[GitHub] [flink] luoyuxia commented on a diff in pull request #19884: [FLINK-26764][table-planner] Support RESPECT NULLS for function FIRST_VALUE/LAST_VALUE

luoyuxia commented on code in PR #19884:
URL: https://github.com/apache/flink/pull/19884#discussion_r911905289


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/aggregate/FirstValueWithRetractAggFunction.java:
##########
@@ -131,16 +143,27 @@ public void accumulate(FirstValueWithRetractAccumulator<T> acc, Object value) th
             }
             orderList.add(order);
             acc.valueToOrderMap.put(v, orderList);
-            accumulate(acc, v, order);
+            accumulate(acc, v, order, ignoreNull);
         }
     }
 
-    @SuppressWarnings("unchecked")
     public void accumulate(FirstValueWithRetractAccumulator<T> acc, Object value, Long order)
             throws Exception {
-        if (value != null) {
+        // default is not ignore null
+        // todo: what's the default value? default ignore null, following legacy code
+        accumulate(acc, value, order, true);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void accumulate(
+            FirstValueWithRetractAccumulator<T> acc, Object value, Long order, boolean ignoreNull)

Review Comment:
   may call accumulate(acc, null, null, false);



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org