ProjectOperator extends PhysicalPlan { @Override public ExecutionEngine.Schema schema() { return new ExecutionEngine.Schema(getProjectList().stream() .map(expr -> new ExecutionEngine.Schema.Column(expr.getName(), expr.getAlias(), expr.type())).collect(Collectors.toList())); }  @Override R accept(PhysicalPlanNodeVisitor<R, C> visitor, C context); @Override List<PhysicalPlan> getChild(); @Override boolean hasNext(); @Override ExprValue next(); @Override ExecutionEngine.Schema schema();  }
@Test public void project_schema() { PhysicalPlan project = project(inputPlan, DSL.named("response", DSL.ref("response", INTEGER)), DSL.named("action", DSL.ref("action", STRING))); assertThat(project.schema().getColumns(), contains( new ExecutionEngine.Schema.Column("response", null, INTEGER), new ExecutionEngine.Schema.Column("action", null, STRING) )); }