use of com.facebook.presto.annotation.UsedByGeneratedCode in project presto by prestodb.
the class ArrayConcatUtils method prependElement.
@UsedByGeneratedCode
public static Block prependElement(Type elementType, Object value, Block block) {
BlockBuilder blockBuilder = elementType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount() + 1);
elementType.writeObject(blockBuilder, value);
for (int i = 0; i < block.getPositionCount(); i++) {
elementType.appendTo(block, i, blockBuilder);
}
return blockBuilder.build();
}
use of com.facebook.presto.annotation.UsedByGeneratedCode in project presto by prestodb.
the class ArrayConcatUtils method appendElement.
@UsedByGeneratedCode
public static Block appendElement(Type elementType, Block block, Object value) {
BlockBuilder blockBuilder = elementType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount() + 1);
for (int i = 0; i < block.getPositionCount(); i++) {
elementType.appendTo(block, i, blockBuilder);
}
elementType.writeObject(blockBuilder, value);
return blockBuilder.build();
}
use of com.facebook.presto.annotation.UsedByGeneratedCode in project presto by prestodb.
the class ArrayConcatUtils method appendElement.
@UsedByGeneratedCode
public static Block appendElement(Type elementType, Block block, double value) {
BlockBuilder blockBuilder = elementType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount() + 1);
for (int i = 0; i < block.getPositionCount(); i++) {
elementType.appendTo(block, i, blockBuilder);
}
elementType.writeDouble(blockBuilder, value);
return blockBuilder.build();
}
use of com.facebook.presto.annotation.UsedByGeneratedCode in project presto by prestodb.
the class ArrayConcatUtils method prependElement.
@UsedByGeneratedCode
public static Block prependElement(Type elementType, boolean value, Block block) {
BlockBuilder blockBuilder = elementType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount() + 1);
elementType.writeBoolean(blockBuilder, value);
for (int i = 0; i < block.getPositionCount(); i++) {
elementType.appendTo(block, i, blockBuilder);
}
return blockBuilder.build();
}
use of com.facebook.presto.annotation.UsedByGeneratedCode in project presto by prestodb.
the class ArrayConcatUtils method prependElement.
// Usage of prependElement: ElementToArrayConcatFunction
@UsedByGeneratedCode
public static Block prependElement(Type elementType, Slice value, Block block) {
BlockBuilder blockBuilder = elementType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount() + 1);
elementType.writeSlice(blockBuilder, value);
for (int i = 0; i < block.getPositionCount(); i++) {
elementType.appendTo(block, i, blockBuilder);
}
return blockBuilder.build();
}
Aggregations