You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "LakshSingla (via GitHub)" <gi...@apache.org> on 2023/10/04 11:08:39 UTC

Re: [PR] Free up the resources when materializing the results as Frames (druid)

LakshSingla commented on code in PR #15032:
URL: https://github.com/apache/druid/pull/15032#discussion_r1345617208


##########
processing/src/main/java/org/apache/druid/query/IterableRowsCursorHelper.java:
##########
@@ -55,8 +64,10 @@ public static RowBasedCursor<Object[]> getCursorFromIterable(Iterable<Object[]>
       }
       return row -> row[columnIndex];
     };
-    RowWalker<Object[]> rowWalker = new RowWalker<>(Sequences.simple(rows), rowAdapter);
-    return new RowBasedCursor<>(
+
+    RowWalker<Object[]> rowWalker = new RowWalker<>(rows, rowAdapter);

Review Comment:
   Revisiting this comment, it doesn't seem fair that the `RowBasedCursor` should close the `rowWalker` that was passed to it by the caller. The caller should close the `rowWalker`.
   
   Either the method `getCursorFromSequence` should return a Pair<Cursor, Closeable> or I will rename `CloseableCursor` to `CursorWithCloseable`



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