Package org.apache.drill.exec.planner.physical.PrelUtil

Examples of org.apache.drill.exec.planner.physical.PrelUtil.ProjectPushInfo


  public void onMatch(RelOptRuleCall call) {
    final ProjectRel proj = (ProjectRel) call.rel(0);
    final EnumerableTableAccessRel scan = (EnumerableTableAccessRel) call.rel(1);

    try {
      ProjectPushInfo columnInfo = PrelUtil.getColumns(scan.getRowType(), proj.getProjects());

      if(columnInfo == null || columnInfo.isStarQuery() //
          || !scan.getTable().unwrap(DrillTable.class) //
          .getGroupScan().canPushdownProjects(columnInfo.columns)) return;

      final DrillScanRel newScan =
          new DrillScanRel(scan.getCluster(),
              scan.getTraitSet().plus(DrillRel.DRILL_LOGICAL),
              scan.getTable(),
              columnInfo.createNewRowType(proj.getChild().getCluster().getTypeFactory()),
              columnInfo.columns);


      List<RexNode> newProjects = Lists.newArrayList();
      for(RexNode n : proj.getChildExps()){
        newProjects.add(n.accept(columnInfo.getInputRewriter()));
      }

      final DrillProjectRel newProj =
          new DrillProjectRel(proj.getCluster(),
              proj.getTraitSet().plus(DrillRel.DRILL_LOGICAL),
View Full Code Here


    List<RelDataTypeField> relDataTypes = new ArrayList();
    List<RelDataTypeField> origRelDataTypes = new ArrayList();
    int i = 0;

    ProjectPushInfo columnInfo = PrelUtil.getColumns(project.getInput(0).getRowType(), project.getProjects());

    List<RexNode> newProjects = Lists.newArrayList();
    if (columnInfo == null ) {
      return project;
    }
    int lastRexInput = columnInfo.columns.size();
    RexVisitorComplexExprSplitter exprSplitter = new RexVisitorComplexExprSplitter(factory, funcReg, lastRexInput);

    for (RexNode n : project.getChildExps()) {
      newProjects.add(n.accept(columnInfo.getInputRewriter()));
    }

    for (RexNode rex : project.getChildExps()) {
      origRelDataTypes.add(project.getRowType().getFieldList().get(i));
      i++;
View Full Code Here

  public void onMatch(RelOptRuleCall call) {
    final ProjectRel proj = (ProjectRel) call.rel(0);
    final EnumerableTableAccessRel scan = (EnumerableTableAccessRel) call.rel(1);

    try {
      ProjectPushInfo columnInfo = PrelUtil.getColumns(scan.getRowType(), proj.getProjects());

      if (columnInfo == null || columnInfo.isStarQuery() //
          || !scan.getTable().unwrap(DrillTable.class) //
          .getGroupScan().canPushdownProjects(columnInfo.columns)) {
        return;
      }

      final DrillScanRel newScan =
          new DrillScanRel(scan.getCluster(),
              scan.getTraitSet().plus(DrillRel.DRILL_LOGICAL),
              scan.getTable(),
              columnInfo.createNewRowType(proj.getChild().getCluster().getTypeFactory()),
              columnInfo.columns);


      List<RexNode> newProjects = Lists.newArrayList();
      for (RexNode n : proj.getChildExps()) {
        newProjects.add(n.accept(columnInfo.getInputRewriter()));
      }

      final DrillProjectRel newProj =
          new DrillProjectRel(proj.getCluster(),
              proj.getTraitSet().plus(DrillRel.DRILL_LOGICAL),
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.planner.physical.PrelUtil.ProjectPushInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.