Skip to content

Commit

Permalink
add back accidentally rm test
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Mar 1, 2023
1 parent 09d150d commit 1ae0943
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,29 @@ private static <T> void testRoundTripSerialization(
try (SafeCloseable ignored = data;
ChunkInputStreamGenerator generator = ChunkInputStreamGenerator.makeInputStreamGenerator(
chunkType, type, type.getComponentType(), srcData, 0)) {
// full sub logic
try (final BarrageProtoUtil.ExposedByteArrayOutputStream baos =
new BarrageProtoUtil.ExposedByteArrayOutputStream();
final ChunkInputStreamGenerator.DrainableColumn column =
generator.getInputStream(options, null)) {


final ArrayList<ChunkInputStreamGenerator.FieldNodeInfo> fieldNodes = new ArrayList<>();
column.visitFieldNodes((numElements, nullCount) -> fieldNodes
.add(new ChunkInputStreamGenerator.FieldNodeInfo(numElements, nullCount)));
final TLongArrayList bufferNodes = new TLongArrayList();
column.visitBuffers(bufferNodes::add);
column.drainTo(baos);
final DataInput dis =
new LittleEndianDataInputStream(new ByteArrayInputStream(baos.peekBuffer(), 0, baos.size()));
try (final WritableChunk<Values> rtData =
ChunkInputStreamGenerator.extractChunkFromInputStream(options,
chunkType, type, type.getComponentType(), fieldNodes.iterator(), bufferNodes.iterator(),
dis, null, 0, 0)) {
Assert.eq(data.size(), "data.size()", rtData.size(), "rtData.size()");
validator.assertExpected(data, rtData, null, 0);
}
}

// empty subset
try (final BarrageProtoUtil.ExposedByteArrayOutputStream baos =
Expand Down

0 comments on commit 1ae0943

Please sign in to comment.