if (columnInfo == null || Utilities.isStarQuery(columnInfo.getFields()) || !groupScan.canPushdownProjects(columnInfo.getFields())) { return; groupScan.clone(columnInfo.getFields()), columnInfo.createNewRowType(project.getInput().getCluster().getTypeFactory()), scan.getTable()); newProjects.add(n.accept(columnInfo.getInputReWriter()));
if (columnInfo == null || Utilities.isStarQuery(columnInfo.getFields()) || !groupScan.canPushdownProjects(columnInfo.getFields())) { return; groupScan.clone(columnInfo.getFields()), columnInfo.createNewRowType(project.getInput().getCluster().getTypeFactory()), scan.getTable()); newProjects.add(n.accept(columnInfo.getInputReWriter()));
scan.getTraitSet().plus(DrillRel.DRILL_LOGICAL), scan.getTable(), projectPushInfo.createNewRowType(project.getInput().getCluster().getTypeFactory()), projectPushInfo.getFields()); newProjects.add(n.accept(projectPushInfo.getInputReWriter()));
ProjectPushInfo getInfo() { return new ProjectPushInfo(ImmutableList.copyOf(newFields), ImmutableMap.copyOf(desiredFields)); }
/** * Push project into scan be done only if this is not a star query and * table supports project push down. * * @param table table instance * @param projectPushInfo fields information * @return true if push project into scan can be performed, false otherwise */ private boolean canPushProjectIntoScan(RelOptTable table, ProjectPushInfo projectPushInfo) throws IOException { DrillTable drillTable = Utilities.getDrillTable(table); return !Utilities.isStarQuery(projectPushInfo.getFields()) && drillTable.getGroupScan().canPushdownProjects(projectPushInfo.getFields()); } }