Annotation Type FunctionAnnotation.ForwardedFieldsFirst
-
@Target(TYPE) @Retention(RUNTIME) public static @interface FunctionAnnotation.ForwardedFieldsFirst
The ForwardedFieldsFirst annotation declares fields of the first input of a function which are never modified by the annotated function and which are forwarded at the same position to the output or unchanged copied to another position in the output.Fields that are forwarded from the first input at the same position in the output can be specified by their position. The specified position must be valid for the input and output data type and have the same type. For example
{@literal @}ForwardedFieldsFirst({"f2"})declares that the third field of a Java input tuple at the first input is copied to the third field of an output tuple.Fields which are unchanged copied to another position in the output are declared by specifying the source field expression in the input and the target field expression in the output.
{@literal @}ForwardedFieldsFirst({"f0->f2"})denotes that the first field of the Java input tuple at the first input is unchanged copied to the third field of the Java output tuple. When using the wildcard ("*") ensure that the number of declared fields and their types in input and output type match.Multiple forwarded fields can be annotated in one (
{@literal @}ForwardedFieldsFirst({"f2; f3->f0; f4"})) or separate Strings ({@literal @}ForwardedFieldsFirst({"f2", "f3->f0", "f4"})).NOTE: The use of the ForwardedFieldsFirst annotation is optional. If used correctly, it can help the Flink optimizer to generate more efficient execution plans. However if used incorrectly, it can cause invalid plan choices and the computation of wrong results! It is NOT required that all forwarded fields are declared, but all declarations must be correct.
Please refer to the JavaDoc of
Functionor Flink's documentation for details on field expressions such as nested fields and wildcard.Forwarded fields from the second input can be specified using the
FunctionAnnotation.ForwardedFieldsSecondannotation.
-
-
Element Detail
-
value
String[] value
-
-