snuyanzin commented on code in PR #26396:
URL: https://github.com/apache/flink/pull/26396#discussion_r2027119920
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionTestUtils.java:
##########
@@ -605,6 +614,80 @@ public void eval(
}
}
+ /** Testing function. */
+ public static class ListStateFunction extends TestProcessTableFunctionBase
{
+ public void eval(
+ Context ctx,
+ @StateHint ListView<String> s,
+ @ArgumentHint({TABLE_AS_SET, OPTIONAL_PARTITION_BY}) Row r)
+ throws Exception {
+ collectObjects(s.getList(), s.getClass().getSimpleName(), r);
+
+ // get
+ int count = s.getList().size();
+
+ // create
+ s.add(String.valueOf(count));
+
+ // null behavior
+ assertThatThrownBy(() -> s.add(null))
+ .isInstanceOf(TableRuntimeException.class)
+ .hasMessageContaining("List views don't support null
values.");
+ assertThatThrownBy(() -> s.addAll(Arrays.asList("item0", null)))
Review Comment:
```suggestion
assertThatThrownBy(() -> s.addAll(List.of("item0", null)))
```
nit: java8 dropped, so we can use `List.of`
--
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]