presto-hive/src/main/java/io/prestosql/plugin/hive/s3select/S3SelectRecordCursor.java/S3SelectRecordCursor/pruneThriftTable
class S3SelectRecordCursor:    private static ThriftTable pruneThriftTable(ThriftTable thriftTable, List<HiveColumnHandle> columns)
    {
        if (thriftTable == null) {
            return null;
        }
        List<ThriftField> fields = thriftTable.getFields();
        if (fields == null || fields.isEmpty()) {
            return thriftTable;
        }
        Set<String> columnNames = columns.stream()
                .map(HiveColumnHandle::getName)
                .collect(toImmutableSet());
        List<ThriftField> filteredFields = fields.stream()
                .filter(field -> columnNames.contains(field.getName()))
                .collect(toList());
        thriftTable.setFields(filteredFields);

        return thriftTable;
    }