@Target(value=TYPE)
@Retention(value=RUNTIME)
public static @interface FunctionAnnotation.ReadFields
The ReadFields annotation declares for a function all fields which it accesses and evaluates, i.e.,
all fields that are used by the function to compute its result.
For example, fields which are evaluated in conditional statements or used for computations are considered to be read.
Fields which are only unmodified copied to the output without evaluating their values are NOT considered to be read.
NOTE: The use of the ReadFields annotation is optional.
If used correctly, it can help the Flink optimizer to generate more efficient execution plans.
The ReadFields annotation requires that ALL read fields are declared.
Otherwise, it can cause invalid plan choices and the computation of wrong results!
Declaring a non-read field as read is not harmful but might reduce optimization potential.
Read fields are declared as a list of field expressions, e.g., \@ReadFields({"f0; f2"})
declares the first and third
field of a Java input tuple to be read. All other fields are considered to not influence the behavior of the function.
Multiple read fields can be declared in one \@ReadFields({"f0; f2"})
or
multiple separate Strings \@ReadFields({"f0", "f2"})
.
Please refer to the JavaDoc of Function
or Flink's documentation for
details on field expressions such as nested fields and wildcard.