Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void endRow() throws IOException {
private void flushBuffer() throws IOException {
if (rowCount == 0) return;
ByteBuffer raw = buffer.asByteBuffer();
ByteBuffer checksumBuf = checksum.compute(raw);
ByteBuffer c = codec.compress(raw);

blockDescriptors.add(new BlockDescriptor(rowCount,
Expand All @@ -81,7 +82,7 @@ private void flushBuffer() throws IOException {

ByteBuffer data = ByteBuffer.allocate(c.remaining() + checksum.size());
data.put(c);
data.put(checksum.compute(raw));
data.put(checksumBuf);
blockData.add(data.array());

int sizeIncrement =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ public TestColumnFile(String codec, String checksum) {

@Parameters public static Collection<Object[]> codecs() {
Object[][] data = new Object[][] {{"null", "null"},
{"null", "crc32"},
{"snappy", "crc32"},
{"deflate", "crc32"}};
{"snappy", "null"},
{"deflate", "crc32"},
{"deflate", "null"}};
return Arrays.asList(data);
}

Expand Down