swuferhong commented on code in PR #23414: URL: https://github.com/apache/flink/pull/23414#discussion_r1325831177
########## flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/factories/TestValuesTableFactory.java: ########## @@ -1244,26 +1244,34 @@ public void applyPartitions(List<Map<String, String>> remainingPartitions) { } else { // we will read data from Collections.emptyList() if allPartitions is empty. // therefore, we should clear all data manually. - remainingPartitions = (List<Map<String, String>>) Collections.emptyMap(); + remainingPartitions = createEmptyRemainingPartitions(); this.data.put(Collections.emptyMap(), Collections.emptyList()); } } else { this.allPartitions = remainingPartitions; if (remainingPartitions.isEmpty()) { - remainingPartitions = (List<Map<String, String>>) Collections.emptyMap(); + remainingPartitions = createEmptyRemainingPartitions(); } } // only keep the data in the remaining partitions this.data = pruneDataByRemainingPartitions(remainingPartitions, this.data); } + private List<Map<String, String>> createEmptyRemainingPartitions() { Review Comment: > What about using `Collections.singletonList(Collections.emptyMap())`? Done! -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org