JingGe commented on code in PR #24788: URL: https://github.com/apache/flink/pull/24788#discussion_r1601394755
########## flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/utils/DynamicPartitionPruningUtils.java: ########## @@ -234,20 +234,16 @@ private static boolean isSuitableFilter(RexNode filterCondition) { } private void setTables(ContextResolvedTable catalogTable) { - if (tables.size() == 0) { - tables.add(catalogTable); - } else { - boolean hasAdded = false; - for (ContextResolvedTable thisTable : new ArrayList<>(tables)) { - if (hasAdded) { - break; - } - if (!thisTable.getIdentifier().equals(catalogTable.getIdentifier())) { - tables.add(catalogTable); - hasAdded = true; - } + boolean alreadyExists = false; + for (ContextResolvedTable table : tables) { Review Comment: Not sure how big the tables could be and how often the method will be called. Does it make sense to use e.g. a Map<K,V> to avoid the loop? -- 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