presto-thrift-api/src/main/java/io/prestosql/plugin/thrift/api/PrestoThriftPageResult.java/PrestoThriftPageResult/fromRecordSet
class PrestoThriftPageResult:    public static PrestoThriftPageResult fromRecordSet(RecordSet recordSet)
    {
        List<Type> types = recordSet.getColumnTypes();
        int numberOfColumns = types.size();
        int positions = totalRecords(recordSet);
        if (numberOfColumns == 0) {
            return new PrestoThriftPageResult(ImmutableList.of(), positions, null);
        }
        List<PrestoThriftBlock> thriftBlocks = new ArrayList<>(numberOfColumns);
        for (int columnIndex = 0; columnIndex < numberOfColumns; columnIndex++) {
            thriftBlocks.add(fromRecordSetColumn(recordSet, columnIndex, positions));
        }
        return new PrestoThriftPageResult(thriftBlocks, positions, null);
    }