Package plan_runner.conversion

Examples of plan_runner.conversion.SumCount


    if (_groupByType == GB_PROJECTION)
      tupleHash = MyUtilities.createHashString(tuple, _groupByColumns,
          _groupByProjection.getExpressions(), _map);
    else
      tupleHash = MyUtilities.createHashString(tuple, _groupByColumns, _map);
    final SumCount sumCount = _storage.update(tuple, tupleHash);
    final String strValue = _wrapper.toString(sumCount);

    // propagate further the affected tupleHash-tupleValue pair
    final List<String> affectedTuple = new ArrayList<String>();
    affectedTuple.add(tupleHash);
View Full Code Here


    final TypeConversion veType = _ve.getType();
    if (veType instanceof SumCountConversion) {
      // when merging results from multiple Components which have SumCount
      // as the output
      final SumCount sc = (SumCount) _ve.eval(tuple);
      sumDelta = sc.getSum();
      countDelta = sc.getCount();
    } else {
      final NumericConversion nc = (NumericConversion) veType;
      sumDelta = nc.toDouble(_ve.eval(tuple));
      countDelta = 1L;
    }

    final Double sumNew = sumDelta + value.getSum();
    final Long countNew = countDelta + value.getCount();

    return new SumCount(sumNew, countNew);
  }
View Full Code Here

  @Override
  public SumCount runAggregateFunction(SumCount value1, SumCount value2) {
    final Double sumNew = value1.getSum() + value2.getSum();
    final Long countNew = value1.getCount() + value2.getCount();
    return new SumCount(sumNew, countNew);
  }
View Full Code Here

TOP

Related Classes of plan_runner.conversion.SumCount

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.