final List<TransferPair> transfers = Lists.newArrayList();
final ClassGenerator<Flattener> cg = CodeGenerator.getRoot(Flattener.TEMPLATE_DEFINITION, context.getFunctionRegistry());
IntOpenHashSet transferFieldIds = new IntOpenHashSet();
RepeatedVector flattenField = ((RepeatedVector) incoming.getValueAccessorById(
incoming.getSchema().getColumn(
incoming.getValueVectorId(
popConfig.getColumn()).getFieldIds()[0]).getValueClass(),
incoming.getValueVectorId(popConfig.getColumn()).getFieldIds()).getValueVector());
NamedExpression namedExpression = new NamedExpression(popConfig.getColumn(), new FieldReference(popConfig.getColumn()));
LogicalExpression expr = ExpressionTreeMaterializer.materialize(namedExpression.getExpr(), incoming, collector, context.getFunctionRegistry(), true);
ValueVectorReadExpression vectorRead = (ValueVectorReadExpression) expr;
TypedFieldId id = vectorRead.getFieldId();
Preconditions.checkNotNull(incoming);
TransferPair tp = null;
if (flattenField instanceof RepeatedMapVector) {
tp = ((RepeatedMapVector)flattenField).getTransferPairToSingleMap();
} else {
ValueVector vvIn = flattenField.getAccessor().getAllChildValues();
tp = vvIn.getTransferPair();
}
transfers.add(tp);
container.add(tp.getTo());
transferFieldIds.add(vectorRead.getFieldId().getFieldIds()[0]);