apilloud commented on a change in pull request #14729:
URL: https://github.com/apache/beam/pull/14729#discussion_r698851378
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/planner/RelMdNodeStats.java
##########
@@ -71,16 +72,34 @@ private NodeStats getBeamNodeStats(BeamRelNode rel,
RelMetadataQuery mq) {
// wraps the metadata provider with CachingRelMetadataProvider. However,
// CachingRelMetadataProvider checks timestamp before returning previous
results. Therefore,
// there wouldn't be a problem in that case.
- List<List> keys =
- mq.map.entrySet().stream()
- .filter(entry -> entry.getValue() instanceof NodeStats)
- .filter(entry -> ((NodeStats) entry.getValue()).isUnknown())
- .map(Map.Entry::getKey)
- .collect(Collectors.toList());
-
- for (List key : keys) {
- mq.map.remove(key);
+ Set<Table.Cell<RelNode, List, Object>> cells = mq.map.cellSet();
+ List<Table.Cell<RelNode, List, Object>> keys = new
ArrayList<>(cells.size());
+ for (Table.Cell<RelNode, List, Object> cell : cells) {
Review comment:
Fine with me.
--
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]