You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/11/09 19:32:50 UTC

[GitHub] [druid] jihoonson commented on a change in pull request #11890: HashJoinEngine: Fix extraneous advance of left cursor.

jihoonson commented on a change in pull request #11890:
URL: https://github.com/apache/druid/pull/11890#discussion_r745947647



##########
File path: processing/src/main/java/org/apache/druid/segment/RowWalker.java
##########
@@ -60,13 +61,16 @@ public T currentRow()
 
   public void advance()
   {
-    if (rowIterator.hasNext()) {
+    if (rowIterator == null) {
+      throw new IllegalStateException("cannot call advance when isDone == true");
+    } else if (rowIterator.hasNext()) {
       current = rowIterator.next();
 
       if (current == null) {
         throw new NullPointerException("null row encountered in walker");
       }
     } else {
+      rowIterator = null;

Review comment:
       nit: perhaps better do `assert rowIterator == null` in `isDone()`.




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org