class BridgeOutputBuilder {

    void fillGPDBWritable(List<OneField> recFields) throws BadRecordException {
        int size = recFields.size();
        if (size == 0) { // size 0 means the resolver couldn't deserialize any
            // of the record fields
            throw new BadRecordException("No fields in record");
        } else if (size != schema.length) {
            throw new BadRecordException("Record has " + size
                    + " fields but the schema size is " + schema.length);
        }

        for (int i = 0; i < size; i++) {
            OneField current = recFields.get(i);
            if (!isTypeInSchema(current.type, schema[i])) {
                throw new BadRecordException(
                        String.format("For field %s schema requires type %s but input record has type %s",
                                colNames[i],
                                DataType.get(schema[i]),
                                DataType.get(current.type)));
            }

            fillOneGPDBWritableField(current, i);
        }

        outputList.add(output);
    }

    public  BridgeOutputBuilder(RequestContext context);

}