@Target(value=TYPE) @Retention(value=RUNTIME) public static @interface FunctionAnnotation.ConstantFieldsFirstExcept
RichFlatJoinFunction
, RichCoGroupFunction
, or RichCrossFunction
.
The following example illustrates a join function that copies fields from the first and second input to the return value:
\@ConstantFieldsFirstExcept("1") public class MyJoin extends JoinFunction, Tuple2 , Tuple3 > { public Tuple3 map(Tuple3 first, Tuple2 second) { return Tuple3 (first.f0, second.f1, first.f2); } }
The annotation takes one String array specifying the positions of the input types that do not remain constant.
When this annotation is used, it is assumed that all other values remain at the same position in input and output.
To model more complex situations use the FunctionAnnotation.ConstantFields
s annotation.
This annotation is mutually exclusive with the FunctionAnnotation.ConstantFieldsFirst
If neither this annotation, nor the FunctionAnnotation.ConstantFieldsFirst
annotation are set, it is
assumed that no field in the first input is forwarded/copied unmodified.
public abstract String[] value
Copyright © 2015 The Apache Software Foundation. All rights reserved.