Create normal block with all null positions in createAllNullsBlock
It is somehow not intuitive that the createAllNullsBlock creates an
RLE block. If the RLE block of a null value is needed - it feels like
there should be an explicit method that does that.
@@ -115,7 +115,11 @@ public final class BlockAssertions
public static Block createAllNullsBlock(Type type, int positionCount)
{
- return new RunLengthEncodedBlock(type.createBlockBuilder(null, 1).appendNull().build(), positionCount);
+ BlockBuilder blockBuilder = type.createBlockBuilder(null, 1);
+ for (int i = 0; i < positionCount; i++) {
+ blockBuilder.appendNull();
+ }
+ return blockBuilder.build();
}
public static Block createStringsBlock(String... values)
