Package plan_runner.components

Examples of plan_runner.components.OperatorComponent


        // but it's certainly pleasant to have the final result grouped
        // on nodes by group by columns.
        final boolean newLevel = !(_it.isHashedBy(affectedComponent, groupByColumns));
        if (newLevel) {
          affectedComponent.setHashIndexes(groupByColumns);
          new OperatorComponent(affectedComponent,
              ParserUtil.generateUniqueName("OPERATOR"), _cg.getQueryPlan())
              .addOperator(firstAgg);

        } else
          affectedComponent.addOperator(firstAgg);
      } else {
        // Sometimes groupByVEs contains other functions, so we have to
        // use projections instead of simple groupBy
        // always new level

        if (affectedComponent.getHashExpressions() != null
            && !affectedComponent.getHashExpressions().isEmpty())
          throw new RuntimeException(
              "Too complex: cannot have hashExpression both for joinCondition and groupBy!");

        // WARNING: groupByVEs cannot be used on two places: that's why
        // we do deep copy
        final ProjectOperator groupByProj = new ProjectOperator(
            (List<ValueExpression>) DeepCopy.copy(groupByVEs));
        if (!(groupByProj.getExpressions() == null || groupByProj.getExpressions()
            .isEmpty()))
          firstAgg.setGroupByProjection(groupByProj);

        // current component
        affectedComponent.setHashExpressions((List<ValueExpression>) DeepCopy
            .copy(groupByVEs));

        new OperatorComponent(affectedComponent, ParserUtil.generateUniqueName("OPERATOR"),
            _cg.getQueryPlan()).addOperator(firstAgg);

      }
    } else
      throw new RuntimeException("For now only one aggregate function supported!");
View Full Code Here


    // -------------------------------------------------------------------------------------
    final AggregateSumOperator agg = new AggregateSumOperator(new ColumnReference(_dc, 1), conf)
        .setGroupByColumns(Arrays.asList(0));

    new OperatorComponent(CUSTOMER_ORDERSjoin, "COUNTAGG", _queryPlan).addOperator(agg);

    // -------------------------------------------------------------------------------------

  }
View Full Code Here

TOP

Related Classes of plan_runner.components.OperatorComponent

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.