clintropolis commented on code in PR #16533:
URL: https://github.com/apache/druid/pull/16533#discussion_r1710314520
##########
processing/src/test/java/org/apache/druid/frame/segment/FrameStorageAdapterTest.java:
##########
@@ -345,58 +367,46 @@ public void tearDown()
}
@Test
- public void test_makeCursors()
+ public void test_makeCursor()
{
- assertCursorsMatch(
- adapter ->
- adapter.makeCursors(
- filter,
- interval,
- virtualColumns,
- Granularities.ALL, // Frames only support Granularities.ALL:
no point testing the others.
- descending,
- null
- )
- );
+ assertCursorMatch(adapter -> adapter.makeCursorHolder(buildSpec));
}
@Test
public void test_makeVectorCursor()
{
- Assume.assumeTrue(frameAdapter.canVectorize(filter, virtualColumns,
descending));
-
- assertVectorCursorsMatch(
- adapter ->
- adapter.makeVectorCursor(
- filter,
- interval,
- virtualColumns,
- descending,
- VECTOR_SIZE,
- null
- )
- );
+ assertVectorCursorsMatch(adapter -> adapter.makeCursorHolder(buildSpec));
}
- private void assertCursorsMatch(final Function<StorageAdapter,
Sequence<Cursor>> call)
+ private void assertCursorMatch(final Function<StorageAdapter,
CursorHolder> call)
{
final RowSignature signature = frameAdapter.getRowSignature();
- final Sequence<List<Object>> queryableRows =
- call.apply(queryableAdapter).flatMap(cursor ->
FrameTestUtil.readRowsFromCursor(cursor, signature));
- final Sequence<List<Object>> frameRows =
- call.apply(frameAdapter)
- .flatMap(cursor ->
FrameTestUtil.readRowsFromCursor(advanceAndReset(cursor), signature));
- FrameTestUtil.assertRowsEqual(queryableRows, frameRows);
+ try (final CursorHolder queryableMaker = call.apply(queryableAdapter);
+ final CursorHolder frameMaker = call.apply(frameAdapter)) {
+ final Sequence<List<Object>> queryableRows =
+ FrameTestUtil.readRowsFromCursor(queryableMaker.asCursor(),
signature);
+ final Sequence<List<Object>> frameRows =
+ FrameTestUtil.readRowsFromCursor(frameMaker.asCursor(), signature);
Review Comment:
oops, this was an oversight, will fix
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]