Package plan_runner.predicates

Examples of plan_runner.predicates.AndPredicate


    visitBinaryOperation(ae);

    final Predicate right = _predStack.pop();
    final Predicate left = _predStack.pop();

    final Predicate and = new AndPredicate(left, right);
    _predStack.push(and);
  }
View Full Code Here


  }

  public Predicate analyse(Predicate toAnalyse) {
    final List<Predicate> inner = toAnalyse.getInnerPredicates();
    if (toAnalyse instanceof AndPredicate)
      return new AndPredicate(analyse(inner.get(0)), analyse(inner.get(1)));
    else if (toAnalyse instanceof OrPredicate)
      return new OrPredicate(analyse(inner.get(0)), analyse(inner.get(1)));
    else if (toAnalyse instanceof ComparisonPredicate)
      return comparisonPredAnalyse(toAnalyse);
    return toAnalyse;
View Full Code Here

        .setHashIndexes(Arrays.asList(3));

    // -------------------------------------------------------------------------------------
    // set up aggregation function on the same StormComponent(Bolt) where
    // the last join is
    final SelectOperator so = new SelectOperator(new OrPredicate(new AndPredicate(
        new ComparisonPredicate(new ColumnReference(_sc, 0), new ValueSpecification(_sc,
            _firstCountryName)), new ComparisonPredicate(new ColumnReference(_sc, 2),
            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),
View Full Code Here

    ComparisonPredicate pred1 = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colR_N_S_L1, colC_O1);
    ComparisonPredicate pred2 = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colR_N_S_L2, colC_O2);
    AndPredicate R_N_S_L_C_O_comp = new AndPredicate(pred1, pred2);

    Component R_N_S_L_C_Ojoin = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, R_N_S_Ljoin, C_Ojoin, _queryPlan)
        .setHashIndexes(hashRNSLCO).addOperator(projectionRNSLCO)
        .setJoinPredicate(R_N_S_L_C_O_comp);
View Full Code Here

        .setJoinPredicate(L_S_N_comp);

    // -------------------------------------------------------------------------------------
    // set up aggregation function on the same StormComponent(Bolt) where
    // the last join is
    final SelectOperator so = new SelectOperator(new OrPredicate(new AndPredicate(
        new ComparisonPredicate(new ColumnReference(_sc, 0), new ValueSpecification(_sc,
            _firstCountryName)), new ComparisonPredicate(new ColumnReference(_sc, 2),
            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),
View Full Code Here

    final Multiplication mult = new Multiplication(value10, colLineItemsInequality);
    final ColumnReference colOrdersInequality = new ColumnReference(_doubleConv, 1);
    final ComparisonPredicate pred2 = new ComparisonPredicate(ComparisonPredicate.LESS_OP,
        mult, colOrdersInequality);

    final AndPredicate overallPred = new AndPredicate(pred1, pred2);

    Component lastJoiner = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, relationLineitem, relationOrders,
            _queryPlan).setJoinPredicate(overallPred)
        .addOperator(new ProjectOperator(new int[] { 1, 2, 4 })).addOperator(agg);
View Full Code Here

    ComparisonPredicate P_L_PS1_comp = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colP_L1, colPS1);

    ComparisonPredicate P_L_PS2_comp = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colP_L2, colPS2);
    AndPredicate P_L_PS = new AndPredicate(P_L_PS1_comp, P_L_PS2_comp);

    Component P_L_PSjoin = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, P_Ljoin, relationPartsupp, _queryPlan)
        .setHashIndexes(Arrays.asList(0))
        .addOperator(new ProjectOperator(new int[] { 1, 2, 3, 4, 5, 8 }))
View Full Code Here

    final ValueSpecification val10 = new ValueSpecification(_doubleConv, 10.0);
    final Multiplication mult = new Multiplication(val10, colRefLineItemExtPrice);
    final ComparisonPredicate predL_O2 = new ComparisonPredicate(ComparisonPredicate.LESS_OP,
        mult, colRefOrdersTotalPrice);

    final AndPredicate predL_O = new AndPredicate(predL_O1, predL_O2);

    Component LINEITEMS_ORDERSjoin = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, relationLineitem, relationOrders,
            _queryPlan).setJoinPredicate(predL_O)
        .addOperator(new ProjectOperator(new int[] { 1, 2, 3, 4 }));

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

    final SelectOperator selectionPartSupp = new SelectOperator(new ComparisonPredicate(
        ComparisonPredicate.GREATER_OP, new ColumnReference(_intConv, 2),
        new ValueSpecification(_intConv, 9990)));

    final ColumnReference colRefSupplier = new ColumnReference(_intConv, 0);
    final ColumnReference colRefPartSupp = new ColumnReference(_intConv, 1);
    final ComparisonPredicate predS_P = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colRefSupplier, colRefPartSupp);

    Component SUPPLIER_PARTSUPPjoin = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, relationSupplier, relationPartsupp,
            _queryPlan).setJoinPredicate(predS_P)
        .addOperator(new ProjectOperator(new int[] { 0, 1, 3 }))
        .addOperator(selectionPartSupp);

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

    // set up aggregation function on the StormComponent(Bolt) where join is
    // performed

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

    final ColumnReference colRefL_OPartKey = new ColumnReference(_intConv, 0);
    final ColumnReference colRefS_PPartKey = new ColumnReference(_intConv, 1);
    final ColumnReference colRefL_OSupKey = new ColumnReference(_intConv, 1);
    final ColumnReference colRefS_PSupKey = new ColumnReference(_intConv, 0);
    final ComparisonPredicate predL_P1 = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colRefL_OPartKey, colRefS_PPartKey);
    final ComparisonPredicate predL_P2 = new ComparisonPredicate(ComparisonPredicate.EQUAL_OP,
        colRefL_OSupKey, colRefS_PSupKey);
    final AndPredicate predL_P = new AndPredicate(predL_P1, predL_P2);

    Component lastJoiner = ThetaJoinComponentFactory
        .createThetaJoinOperator(Theta_JoinType, LINEITEMS_ORDERSjoin,
            SUPPLIER_PARTSUPPjoin, _queryPlan).setJoinPredicate(predL_P)
        .addOperator(new ProjectOperator(new int[] { 0, 1, 2, 3 })).addOperator(agg);
View Full Code Here

TOP

Related Classes of plan_runner.predicates.AndPredicate

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.