{
TupleInfo.Type[] types = new TupleInfo.Type[numberOfFields];
Arrays.fill(types, getValueType());
types[numberOfFields - 1] = getValueType();
BlockBuilder blockBuilder = new BlockBuilder(new TupleInfo(types));
for (Object value : values) {
for (int i = 0; i < numberOfFields - 1; i++) {
blockBuilder.appendNull();
}
if (value == null) {
blockBuilder.appendNull();
}
else {
switch (getValueType()) {
case FIXED_INT_64:
blockBuilder.append((Long) value);
break;
case VARIABLE_BINARY:
blockBuilder.append((Slice) value);
break;
case DOUBLE:
blockBuilder.append((Double) value);
break;
default:
throw new UnsupportedOperationException("not yet implemented");
}
}
}
return blockBuilder.build();
}