|
65 | 65 | import java.util.concurrent.TimeUnit; |
66 | 66 |
|
67 | 67 | import static org.apache.iotdb.db.queryengine.execution.fragment.FragmentInstanceContext.createFragmentInstanceContext; |
| 68 | +import static org.apache.iotdb.db.queryengine.execution.operator.OperatorTestUtils.isNullOrEmpty; |
68 | 69 | import static org.apache.iotdb.db.queryengine.execution.operator.OperatorTestUtils.nextNonNull; |
69 | 70 | import static org.junit.Assert.assertEquals; |
70 | 71 | import static org.junit.Assert.assertTrue; |
@@ -383,11 +384,11 @@ public void batchTest3() throws Exception { |
383 | 384 | new OffsetOperator(driverContext.getOperatorContexts().get(3), 500, timeJoinOperator); |
384 | 385 |
|
385 | 386 | while (offsetOperator.isBlocked().isDone() && offsetOperator.hasNext()) { |
386 | | - TsBlock tsBlock = nextNonNull(offsetOperator); |
387 | | - assertEquals(2, tsBlock.getValueColumnCount()); |
388 | | - assertTrue(tsBlock.getColumn(0) instanceof IntColumn); |
389 | | - assertTrue(tsBlock.getColumn(1) instanceof IntColumn); |
390 | | - assertEquals(0, tsBlock.getPositionCount()); |
| 387 | + TsBlock tsBlock = offsetOperator.next(); |
| 388 | + if (isNullOrEmpty(tsBlock)) { |
| 389 | + continue; |
| 390 | + } |
| 391 | + fail("Expected no data from offset operator"); |
391 | 392 | } |
392 | 393 | } catch (IllegalPathException e) { |
393 | 394 | e.printStackTrace(); |
@@ -475,11 +476,11 @@ public void batchTest4() throws Exception { |
475 | 476 | driverContext.getOperatorContexts().get(3), 98_784_247_808L, timeJoinOperator); |
476 | 477 |
|
477 | 478 | while (offsetOperator.isBlocked().isDone() && offsetOperator.hasNext()) { |
478 | | - TsBlock tsBlock = nextNonNull(offsetOperator); |
479 | | - assertEquals(2, tsBlock.getValueColumnCount()); |
480 | | - assertTrue(tsBlock.getColumn(0) instanceof IntColumn); |
481 | | - assertTrue(tsBlock.getColumn(1) instanceof IntColumn); |
482 | | - assertEquals(0, tsBlock.getPositionCount()); |
| 479 | + TsBlock tsBlock = offsetOperator.next(); |
| 480 | + if (isNullOrEmpty(tsBlock)) { |
| 481 | + continue; |
| 482 | + } |
| 483 | + fail("Expected no data from offset operator"); |
483 | 484 | } |
484 | 485 | } catch (IllegalPathException e) { |
485 | 486 | e.printStackTrace(); |
|
0 commit comments