Examples of AggregateOperator


Examples of plan_runner.operators.AggregateOperator

        _queryPlan).setHashIndexes(Arrays.asList(1));

    // -------------------------------------------------------------------------------------
    // set up aggregation function on a separate StormComponent(Bolt)
    final DistinctOperator distinctOp = new DistinctOperator(conf, new int[] { 0 });
    final AggregateOperator aggOp = new AggregateCountOperator(conf).setGroupByColumns(
        Arrays.asList(1)).setDistinct(distinctOp);
    new OperatorComponent(O_Ljoin, "FINAL_RESULT", _queryPlan).addOperator(aggOp);

    // -------------------------------------------------------------------------------------
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

        _doubleConv, 3), new ColumnReference(_doubleConv, 0));

    // all together
    final ValueExpression<Double> substract2 = new Subtraction(product1, product2);

    final AggregateOperator agg = new AggregateSumOperator(substract2, conf)
        .setGroupByColumns(Arrays.asList(5, 4));

    new EquiJoinComponent(P_L_PS_O_Sjoin, relationNation, _queryPlan).addOperator(
        new ProjectOperator(new int[] { 0, 1, 2, 3, 4, 6 })).addOperator(agg);
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

        _doubleConv, 1.0), new ColumnReference(_doubleConv, 2));
    // extendedPrice*(1-discount)
    final ValueExpression<Double> product = new Multiplication(new ColumnReference(_doubleConv,
        1), substract);

    final AggregateOperator aggOp = new AggregateSumOperator(product, conf)
        .setGroupByColumns(Arrays.asList(0));
    new OperatorComponent(R_N_S_L_C_Ojoin, "FINAL_RESULT", _queryPlan).addOperator(aggOp);

    // -------------------------------------------------------------------------------------
  }
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

        .createThetaJoinOperator(Theta_JoinType, relationOrders, relationLineitem,
            _queryPlan).setHashIndexes(Arrays.asList(1)).setJoinPredicate(O_L_comp);

    //-------------------------------------------------------------------------------------
    // set up aggregation function on a separate StormComponent(Bolt)
    AggregateOperator aggOp = new AggregateCountOperator(conf).setGroupByColumns(Arrays
        .asList(1));
    OperatorComponent finalComponent = new OperatorComponent(O_Ljoin, "FINAL_RESULT",
        _queryPlan).addOperator(aggOp);

    //-------------------------------------------------------------------------------------
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

            new ValueSpecification(_sc, _secondCountryName))), new AndPredicate(
        new ComparisonPredicate(new ColumnReference(_sc, 0), new ValueSpecification(_sc,
            _secondCountryName)), new ComparisonPredicate(new ColumnReference(_sc, 2),
            new ValueSpecification(_sc, _firstCountryName)))));

    final AggregateOperator agg = new AggregateSumOperator(new ColumnReference(_doubleConv, 4),
        conf).setGroupByColumns(Arrays.asList(2, 0, 3));

    new EquiJoinComponent(N_C_Ojoin, L_S_Njoin, _queryPlan).addOperator(so).addOperator(agg);

  }
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

    final ValueExpression<Double> substract = new Subtraction(new ValueSpecification(
        _doubleConv, 1.0), new ColumnReference(_doubleConv, 4));
    // extendedPrice*(1-discount)
    final ValueExpression<Double> product = new Multiplication(new ColumnReference(_doubleConv,
        3), substract);
    final AggregateOperator agg = new AggregateSumOperator(product, conf)
        .setGroupByColumns(Arrays.asList(0, 1, 2));

    new EquiJoinComponent(C_Ojoin, relationLineitem, _queryPlan).addOperator(agg);

    // -------------------------------------------------------------------------------------
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

    final DataSourceComponent relationNation = new DataSourceComponent("NATION", dataPath
        + "nation" + extension, _queryPlan).addOperator(projectionNation).setHashIndexes(
        hashNation);

    final AggregateOperator agg = new AggregateSumOperator(new ColumnReference(_doubleConv, 0),
        conf);
    // Empty parameters = Cartesian Product

    Component lastJoiner = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, relationSupplier, relationNation,
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

    ValueExpression<Double> substract = new Subtraction(
        new ValueSpecification(_doubleConv, 1.0), new ColumnReference(_doubleConv, 8));
    //extendedPrice*(1-discount)
    ValueExpression<Double> product = new Multiplication(new ColumnReference(_doubleConv, 7),
        substract);
    AggregateOperator agg = new AggregateSumOperator(product, conf)
    //.setGroupByColumns(Arrays.asList(0, 1, 4, 6, 2, 3, 5));
        .setGroupByColumns(Arrays.asList(0, 1, 4, 6, 2, 3, 5));

    ColumnReference colC_O_N = new ColumnReference(_ic, 6);
    ColumnReference colL = new ColumnReference(_ic, 0);
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

        new ValueSpecification(_doubleConv, 1.0), new ColumnReference(_doubleConv, 2));
    //extendedPrice*(1-discount)
    ValueExpression<Double> product = new Multiplication(new ColumnReference(_doubleConv, 1),
        substract);

    AggregateOperator aggOp = new AggregateSumOperator(product, conf).setGroupByColumns(Arrays
        .asList(0));
    OperatorComponent finalComponent = new OperatorComponent(R_N_S_L_C_Ojoin, "FINAL_RESULT",
        _queryPlan).addOperator(aggOp);

    //-------------------------------------------------------------------------------------
View Full Code Here

Examples of plan_runner.operators.AggregateOperator

    if (aggOps.isEmpty()) {
      if (project != null)
        lastComponent.addOperator(project);
    } else if (aggOps.size() == 1) {
      // all the others are group by
      final AggregateOperator firstAgg = aggOps.get(0);
      if (project != null)
        firstAgg.setGroupByProjection(project);

      /*
       * Avg result cannot be aggregated over multiple nodes. Solution is
       * one of the following: a) the output of average is keeped in a
       * form (Sum, Count) and then a user is responsible to aggregate it
       * over nodes b) if NameTranslator.isSuperset for last join keys and
       * GroupBy is not fullfilled create new level node with aggregation
       * as the only operation To be akin to Sum and Count aggregates, we
       * opted for a)
       */
      if (firstAgg.getDistinct() == null)
        lastComponent.addOperator(firstAgg);
      else
        // in general groupByVEs is not a ColumnReference (it can be an
        // addition, for example).
        // ProjectOperator is not obliged to create schema which fully
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.