@Test public void testEmptyPartitionSkip() throws Exception { TestUtils.assertMemoryLeak(() -> { try (TableModel model = new TableModel(configuration, "x", PartitionBy.NONE). col("a", ColumnType.INT). col("b", ColumnType.INT). timestamp() ) { CairoTestUtils.create(model); } long timestamp; final Rnd rnd = new Rnd(); try (TableWriter writer = new TableWriter(configuration, "x")) { timestamp = TimestampFormatUtils.parseDateTime("1970-01-03T08:00:00.000Z"); TableWriter.Row row = writer.newRow(timestamp); row.putInt(0, rnd.nextInt()); row.putInt(1, rnd.nextInt()); try (TableReader reader = new TableReader(configuration, "x")) { FullFwdDataFrameCursor cursor = new FullFwdDataFrameCursor(); int frameCount = 0; cursor.of(reader); while (cursor.next() != null) { frameCount++; } Assert.assertEquals(0, frameCount); } } }); }
@Override public @Nullable DataFrame next() { while (this.partitionIndex < partitionHi) { final long hi = getTableReader().openPartition(partitionIndex); if (hi < 1) { partitionIndex++; } else { frame.partitionIndex = partitionIndex; frame.rowHi = hi; partitionIndex++; return frame; } } return null; }
FullFwdDataFrameCursor extends AbstractFullDataFrameCursor { @Override public @Nullable DataFrame next() { while (this.partitionIndex < partitionHi) { final long hi = getTableReader().openPartition(partitionIndex); if (hi < 1) { partitionIndex++; } else { frame.partitionIndex = partitionIndex; frame.rowHi = hi; partitionIndex++; return frame; } } return null; } }
FullFwdDataFrameCursor extends AbstractFullDataFrameCursor { @Override public @Nullable DataFrame next() { while (this.partitionIndex < partitionHi) { final long hi = getTableReader().openPartition(partitionIndex); if (hi < 1) { partitionIndex++; } else { frame.partitionIndex = partitionIndex; frame.rowHi = hi; partitionIndex++; return frame; } } return null; }  }
FullFwdDataFrameCursor extends AbstractFullDataFrameCursor { @Override public @Nullable DataFrame next() { while (this.partitionIndex < partitionHi) { final long hi = getTableReader().openPartition(partitionIndex); if (hi < 1) { partitionIndex++; } else { frame.partitionIndex = partitionIndex; frame.rowHi = hi; partitionIndex++; return frame; } } return null; }  @Override @Nullable DataFrame next(); @Override void toTop(); }
FullFwdDataFrameCursor extends AbstractFullDataFrameCursor { @Override public @Nullable DataFrame next() { while (this.partitionIndex < partitionHi) { final long hi = getTableReader().openPartition(partitionIndex); if (hi < 1) { partitionIndex++; } else { frame.partitionIndex = partitionIndex; frame.rowHi = hi; partitionIndex++; return frame; } } return null; }  @Override @Nullable DataFrame next(); @Override void toTop();  }