Package cascading.operation.aggregator

Examples of cascading.operation.aggregator.Sum


    pipe = new Each( pipe, new Fields( "line" ), new ExpressionFunction( new Fields( "hash" ), "line.hashCode() % " + modulo, String.class ), Fields.ALL ); // want some collisions

    pipe = new GroupBy( pipe, new Fields( "hash" ) );

    for( int i = 0; i < depth; i++ )
      pipe = new Every( pipe, new Fields( "count" ), new Sum( new Fields( "sum" + ( i + 1 ) ) ) );

    for( int i = 0; i < depth; i++ )
      {
      pipe = new Each( pipe, new Fields( "hash" ), new Identity( new Fields( 0 ) ), Fields.ALL );
      pipe = new Each( pipe, new Fields( "sum1" ), new Identity( new Fields( 0 ) ), Fields.ALL );
View Full Code Here


      count += 2; // 2 taps

      if( i > 0 )
        {
        pipe = new CoGroup( pipes[ i - 1 ], new Fields( "key" + ( i - 1 ) ), pipe, new Fields( "key" + i ) );
        pipe = new Every( pipe, new Fields( "key" + ( i - 1 ) ), new Sum() );
        count += 2; // 2 pipes
        }

      pipes[ i ] = new Pipe( nameOut, pipe );
      count += 1; // 1 pipe
View Full Code Here

    pipe = new Each( pipe, new Fields( "rate1", "rate2" ), sqDiff, Fields.ALL );

    // sum and sqr for each name pair
    pipe = new GroupBy( pipe, new Fields( "name1", "name2" ) );

    Sum distance = new Sum( new Fields( "distance" ) )
    {
    public void complete( FlowProcess flowProcess, AggregatorCall aggregatorCall )
      {
      Tuple tuple = super.getResult( aggregatorCall );
View Full Code Here

    pipe = new Each( pipe, new Fields( "rate1", "rate2" ), sqDiff, Fields.ALL );

    // sum and sqr for each name pair
    pipe = new GroupBy( pipe, new Fields( "name1", "name2" ) );

    Sum distance = new Sum( new Fields( "distance" ) )
    {
    public void complete( FlowProcess flowProcess, AggregatorCall aggregatorCall )
      {
      Tuple tuple = super.getResult( aggregatorCall );
View Full Code Here

   * @param sumField   of type Fields
   */
  @ConstructorProperties({"valueField", "sumField"})
  public SumBy( Fields valueField, Fields sumField )
    {
    super( valueField, new SumPartials( sumField ), new Sum( sumField ) );
    }
View Full Code Here

   * @param threshold      of type int
   */
  @ConstructorProperties({"name", "pipes", "groupingFields", "valueField", "sumField", "threshold"})
  public SumBy( String name, Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, int threshold )
    {
    super( name, pipes, groupingFields, valueField, new SumPartials( sumField ), new Sum( sumField ), threshold );
    }
View Full Code Here

   * @param sumType    of type Class
   */
  @ConstructorProperties({"valueField", "sumField", "sumType"})
  public SumBy( Fields valueField, Fields sumField, Class sumType )
    {
    super( valueField, new SumPartials( sumField, sumType ), new Sum( sumField, sumType ) );
    }
View Full Code Here

   * @param threshold      of type int
   */
  @ConstructorProperties({"name", "pipes", "groupingFields", "valueField", "sumField", "sumType", "threshold"})
  public SumBy( String name, Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, Class sumType, int threshold )
    {
    super( name, pipes, groupingFields, valueField, new SumPartials( sumField, sumType ), new Sum( sumField, sumType ), threshold );
    }
View Full Code Here

   * @param countField of type Fields
   */
  @ConstructorProperties({"countField"})
  public CountBy( Fields countField )
    {
    super( Fields.ALL, new CountPartials( countField.applyTypes( Long.TYPE ) ), new Sum( countField.applyTypes( Long.TYPE ) ) );
    }
View Full Code Here

   * @param include    of type Include
   */
  @ConstructorProperties({"countField", "include"})
  public CountBy( Fields countField, Include include )
    {
    super( Fields.ALL, new CountPartials( countField.applyTypes( Long.TYPE ), include ), new Sum( countField.applyTypes( Long.TYPE ) ) );
    }
View Full Code Here

TOP

Related Classes of cascading.operation.aggregator.Sum

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.