@Target(value=TYPE) @Retention(value=RUNTIME) public static @interface FunctionAnnotation.ConstantFieldsSecondExcept
RichFlatJoinFunction
, RichCoGroupFunction
, or RichCrossFunction
.
The following example illustrates a join function that copies fields from the first and second input to the return value:
\@ConstantFieldsSecondExcept("1") public class MyJoin extends JoinFunction, Tuple3 , Tuple3 > { public Tuple3 map(Tuple2 first, Tuple3 second) { return Tuple3 (second.f0, first.f1, second.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.ConstantFieldsSecond
If neither this annotation, nor the FunctionAnnotation.ConstantFieldsSecond
annotation are set, it is
assumed that no field in the second input is forwarded/copied unmodified.
public abstract String[] value
Copyright © 2015 The Apache Software Foundation. All rights reserved.