presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/Row.java/Row/extractRow
class Row:    public static Row extractRow(Page page, int position, List<Type> types)
    {
        checkArgument(page.getChannelCount() == types.size(), "channelCount does not match");
        checkArgument(position < page.getPositionCount(), "Requested position %s from a page with positionCount %s ", position, page.getPositionCount());

        RowBuilder rowBuilder = new RowBuilder(page.getChannelCount());
        for (int channel = 0; channel < page.getChannelCount(); channel++) {
            Block block = page.getBlock(channel);
            Type type = types.get(channel);
            long size;
            Object value = getNativeContainerValue(type, block, position);
            if (value == null) {
                size = SIZE_OF_BYTE;
            }
            else if (type.getJavaType() == boolean.class) {
                size = SIZE_OF_BYTE;
            }
            else if (type.getJavaType() == long.class) {
                size = SIZE_OF_LONG;
            }
            else if (type.getJavaType() == double.class) {
                size = SIZE_OF_DOUBLE;
            }
            else if (type.getJavaType() == Slice.class) {
                size = ((Slice) value).length();
            }
            else if (type.getJavaType() == Block.class) {
                size = ((Block) value).getSizeInBytes();
            }
            else {
                throw new AssertionError("Unimplemented type: " + type);
            }
            rowBuilder.add(nativeContainerToOrcValue(type, value), size);
        }
        Row row = rowBuilder.build();
        verify(row.getColumns().size() == types.size(), "Column count in row: %s Expected column count: %s", row.getColumns().size(), types.size());
        return row;
    }