/** * Method set sets the value in the given position. * <p> * No coercion is performed if there is an associated coercible type. * * @param pos position to set * @param value of type Comparable */ public void setRaw( int pos, Object value ) { tuple.set( pos, value ); }
private static Tuple reset( Tuple tuple, Object value ) { tuple.set( 0, value ); return tuple; } }
public Context reset() { nulls = 0L; sum = 0.0D; count = 0L; tuple.set( 0, null ); return this; }
public Tuple result() { tuple.set( 0, canonical.canonical( sum / count ) ); return tuple; } }
@Override public Tuple makeResult( Tuple input, Tuple output ) { Tuple result = new Tuple( input ); result.set( Fields.UNKNOWN, resultFields, output ); return result; } };
public Tuple result() { // we only saw null from upstream, so return null if( count == 0 && nulls != 0 ) return tuple; tuple.set( 0, canonical.canonical( sum / count ) ); return tuple; } }
/** * Method set sets the value in the given field or position. * <p> * No coercion is performed if there is an associated coercible type. * * @param fieldName field name or position to set * @param value of type Comparable */ public void setRaw( Comparable fieldName, Object value ) { tuple.set( fields.getPos( asFieldName( fieldName ) ), value ); }
@Override public Tuple complete( FlowProcess flowProcess, Tuple context ) { context.set( 0, canonical.canonical( context.getObject( 0 ) ) ); return context; } }
@Override public Tuple aggregate( FlowProcess flowProcess, TupleEntry args, Tuple context ) { if( context == null ) context = Tuple.size( 2 ); if( include == Include.NO_NULLS && args.getObject( 0 ) == null ) return context; context.set( 0, context.getDouble( 0 ) + args.getDouble( 0 ) ); context.set( 1, context.getLong( 1 ) + 1 ); return context; }
Tuple nulledCopy( int[] pos ) { if( pos == null ) return size( size() ); Tuple results = new Tuple( this ); for( int i : pos ) results.set( i, null ); return results; }
@Override public Tuple aggregate( FlowProcess flowProcess, TupleEntry args, Tuple context ) { if( context == null ) return args.getTupleCopy(); else if( args.getObject( 0 ) == null ) return context; context.set( 0, context.getDouble( 0 ) + args.getDouble( 0 ) ); return context; }
@Override public void start( FlowProcess flowProcess, AggregatorCall<Pair<Double[], Tuple>> aggregatorCall ) { aggregatorCall.getContext().getLhs()[ 0 ] = null; aggregatorCall.getContext().getRhs().set( 0, null ); }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Context> functionCall ) { Node rootNode = getResultNode( functionCall ); TupleEntry arguments = functionCall.getArguments(); builder.build( arguments::getObject, rootNode ); Context context = functionCall.getContext(); context.result.set( 0, rootNode ); functionCall.getOutputCollector().add( context.result ); } }
protected Tuple getResult( AggregatorCall<Pair<Long[], Tuple>> aggregatorCall ) { aggregatorCall.getContext().getRhs().set( 0, aggregatorCall.getContext().getLhs()[ 0 ] ); return aggregatorCall.getContext().getRhs(); } }
public static Tuple setOnEmpty( TupleEntry baseEntry, TupleEntry valuesEntry ) { Tuple emptyTuple = Tuple.size( baseEntry.getFields().size() ); emptyTuple.set( baseEntry.getFields(), valuesEntry.getFields(), valuesEntry.getTuple() ); return emptyTuple; }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Tuple> functionCall ) { functionCall.getContext().set( 0, functionCall.getArguments().getTuple().toString( delimiter, false ) ); functionCall.getOutputCollector().add( functionCall.getContext() ); }
@Override public void operate( FlowProcess flowProcess, FunctionCall<ExpressionOperation.Context> functionCall ) { functionCall.getContext().result.set( 0, evaluate( functionCall.getContext(), functionCall.getArguments() ) ); functionCall.getOutputCollector().add( functionCall.getContext().result ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Context> functionCall ) { functionCall.getContext().result.set( 0, evaluate( functionCall.getContext(), functionCall.getArguments() ) ); functionCall.getOutputCollector().add( functionCall.getContext().result ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Tuple> functionCall ) { functionCall.getContext().set( 0, functionCall.getArguments().getTuple().format( format ) ); functionCall.getOutputCollector().add( functionCall.getContext() ); }
protected Tuple getResult( AggregatorCall<Pair<Double[], Tuple>> aggregatorCall ) { aggregatorCall.getContext().getRhs().set( 0, canonical.canonical( aggregatorCall.getContext().getLhs()[ 0 ] ) ); return aggregatorCall.getContext().getRhs(); }