@Target(value=TYPE) @Retention(value=RUNTIME) public static @interface FunctionAnnotation.ConstantFields
RichMapFunction
, RichReduceFunction
, or RichFlatMapFunction
.
The following example illustrates a function that keeps the tuple's field zero constant:
\@ConstantFields("0") public class MyMapper extends MapFunction, Tuple2 > { public Tuple2 map(Tuple3 value) { return new Tuple2 (value.f0, value.f1 * 0.5); } }
(Note that you could equivalently write @ConstantFields("0 -> 0")
.
This annotation is mutually exclusive with the FunctionAnnotation.ConstantFieldsExcept
annotation.
If neither this annotation, nor the FunctionAnnotation.ConstantFieldsExcept
annotation are set, it is
assumed that no field in the input is forwarded/copied unmodified.
public abstract String[] value
Copyright © 2015 The Apache Software Foundation. All rights reserved.