presto-thrift-api/src/main/java/io/prestosql/plugin/thrift/api/PrestoThriftBlock.java/PrestoThriftBlock/fromRecordSetColumn
class PrestoThriftBlock:    public static PrestoThriftBlock fromRecordSetColumn(RecordSet recordSet, int columnIndex, int totalRecords)
    {
        Type type = recordSet.getColumnTypes().get(columnIndex);
        // use more efficient implementations for numeric types which are likely to be used in index join
        if (type instanceof IntegerType) {
            return PrestoThriftInteger.fromRecordSetColumn(recordSet, columnIndex, totalRecords);
        }
        if (type instanceof BigintType) {
            return PrestoThriftBigint.fromRecordSetColumn(recordSet, columnIndex, totalRecords);
        }
        if (type instanceof DateType) {
            return PrestoThriftDate.fromRecordSetColumn(recordSet, columnIndex, totalRecords);
        }
        if (type instanceof TimestampType) {
            return PrestoThriftTimestamp.fromRecordSetColumn(recordSet, columnIndex, totalRecords);
        }
        // less efficient implementation which converts to a block first
        return fromBlock(convertColumnToBlock(recordSet, columnIndex, totalRecords), type);
    }