private static <T> void verifyBlock(Block block, T[] expectedValues) { assertBlock(block, expectedValues); assertColumnarArray(block, expectedValues); assertDictionaryBlock(block, expectedValues); assertRunLengthEncodedBlock(block, expectedValues); int offset = 1; int length = expectedValues.length - 2; Block blockRegion = block.getRegion(offset, length); T[] expectedValuesRegion = Arrays.copyOfRange(expectedValues, offset, offset + length); assertBlock(blockRegion, expectedValuesRegion); assertColumnarArray(blockRegion, expectedValuesRegion); assertDictionaryBlock(blockRegion, expectedValuesRegion); assertRunLengthEncodedBlock(blockRegion, expectedValuesRegion); }
private static <T> void assertDictionaryBlock(Block block, T[] expectedValues) { DictionaryBlock dictionaryBlock = createTestDictionaryBlock(block); T[] expectedDictionaryValues = createTestDictionaryExpectedValues(expectedValues); assertBlock(dictionaryBlock, expectedDictionaryValues); assertColumnarArray(dictionaryBlock, expectedDictionaryValues); assertRunLengthEncodedBlock(dictionaryBlock, expectedDictionaryValues); }
private static <T> void assertRunLengthEncodedBlock(Block block, T[] expectedValues) { for (int position = 0; position < block.getPositionCount(); position++) { RunLengthEncodedBlock runLengthEncodedBlock = createTestRleBlock(block, position); T[] expectedDictionaryValues = createTestRleExpectedValues(expectedValues, position); assertBlock(runLengthEncodedBlock, expectedDictionaryValues); assertColumnarArray(runLengthEncodedBlock, expectedDictionaryValues); } }