[ 
https://issues.apache.org/jira/browse/BEAM-9379?focusedWorklogId=643721&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-643721
 ]

ASF GitHub Bot logged work on BEAM-9379:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Aug/21 21:12
            Start Date: 30/Aug/21 21:12
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on a change in pull request #14729:
URL: https://github.com/apache/beam/pull/14729#discussion_r698811973



##########
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) {
+      if (cell == null) {
+        continue;
+      }
+      Object rawValue = cell.getValue();
+      if (!(rawValue instanceof NodeStats)) {
+        continue;
+      }
+      NodeStats nodeStats = (NodeStats) rawValue;
+      if (nodeStats.isUnknown()) {
+        keys.add(cell);
+      }
     }
+    //    List<Table.Cell<RelNode, List, Object>> keys =
+    //        mq.map.cellSet().stream()
+    //            .filter(entry -> entry.getValue() instanceof NodeStats)
+    //            .filter(entry -> ((NodeStats) entry.getValue()).isUnknown())
+    //            .collect(Collectors.toList());
+
+    // === > Task :sdks:java:extensions:sql:compileJava
+    // ===   error: [dereference.of.nullable] dereference of possibly-null 
reference
+    //       ((NodeStats)entry.getValue())
+    // ===   .filter(entry -> ((NodeStats) entry.getValue()).isUnknown())
+    // ===   ^

Review comment:
       Deleted.




-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 643721)
    Time Spent: 28h 50m  (was: 28h 40m)

> Upgrade to Calcite 1.26.0
> -------------------------
>
>                 Key: BEAM-9379
>                 URL: https://issues.apache.org/jira/browse/BEAM-9379
>             Project: Beam
>          Issue Type: Task
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Andrew Pilloud
>            Priority: P2
>          Time Spent: 28h 50m
>  Remaining Estimate: 0h
>
> Upgrade to Calcite 1.22.0 after it gets released (expected by end of Feb 
> 2020).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to