@Test
public void x() throws Exception{
DrillConfig c = DrillConfig.create();
FunctionImplementationRegistry reg = new FunctionImplementationRegistry(c);
EvaluationVisitor v = new EvaluationVisitor(reg);
CodeGenerator<?> g = CodeGenerator.get(Projector.TEMPLATE_DEFINITION, reg);
SchemaPath path = (SchemaPath) getExpr("a.b[4][2].c[6]");
TypedFieldId id = TypedFieldId.newBuilder() //
.addId(1) //
.addId(3) //
.remainder(path.getRootSegment()) //
.intermediateType(Types.optional(MinorType.MAP))
.finalType(Types.repeated(MinorType.MAP)) //
.hyper() //
.withIndex() //
.build();
ValueVectorReadExpression e = new ValueVectorReadExpression(id);
TypedFieldId outId = TypedFieldId.newBuilder() //
.addId(1) //
.finalType(Types.repeated(MinorType.MAP)) //
.intermediateType(Types.repeated(MinorType.MAP)) //
.build();
ValueVectorWriteExpression e2 = new ValueVectorWriteExpression(outId, e, true);
v.addExpr(e2, g.getRoot());
System.out.println(g.generateAndGet());
}