Skip to content

Commit

Permalink
Size BlockBuilder appropriately in map_keys
Browse files Browse the repository at this point in the history
Previously we allocated one row worth of space per byte of input
  • Loading branch information
cberner committed Dec 22, 2015
1 parent e86b1fe commit 6ed858b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ScalarFunctionImplementation specialize(Map<String, Type> types, int arit

public static Block getKeys(Type keyType, Block block)
{
BlockBuilder blockBuilder = keyType.createBlockBuilder(new BlockBuilderStatus(), block.getSizeInBytes());
BlockBuilder blockBuilder = keyType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount() / 2);
for (int i = 0; i < block.getPositionCount(); i += 2) {
keyType.appendTo(block, i, blockBuilder);
}
Expand Down

0 comments on commit 6ed858b

Please sign in to comment.