Class SingleInputUdfOperator<IN,​OUT,​O extends SingleInputUdfOperator<IN,​OUT,​O>>

    • Constructor Detail

      • SingleInputUdfOperator

        protected SingleInputUdfOperator​(DataSet<IN> input,
                                         org.apache.flink.api.common.typeinfo.TypeInformation<OUT> resultType)
        Deprecated.
        Creates a new operators with the given data set as input. The given result type describes the data type of the elements in the data set produced by the operator.
        Parameters:
        input - The data set that is the input to the operator.
        resultType - The type of the elements in the resulting data set.
    • Method Detail

      • getFunction

        protected abstract org.apache.flink.api.common.functions.Function getFunction()
        Deprecated.
      • withParameters

        public O withParameters​(org.apache.flink.configuration.Configuration parameters)
        Deprecated.
        Description copied from interface: UdfOperator
        Sets the configuration parameters for the UDF. These are optional parameters that are passed to the UDF in the AbstractRichFunction.open(Configuration) method.
        Specified by:
        withParameters in interface UdfOperator<IN>
        Parameters:
        parameters - The configuration parameters for the UDF.
        Returns:
        The operator itself, to allow chaining function calls.
      • withBroadcastSet

        public O withBroadcastSet​(DataSet<?> data,
                                  String name)
        Deprecated.
        Description copied from interface: UdfOperator
        Adds a certain data set as a broadcast set to this operator. Broadcasted data sets are available at all parallel instances of this operator. A broadcast data set is registered under a certain name, and can be retrieved under that name from the operators runtime context via RuntimeContext.getBroadcastVariable(String).

        The runtime context itself is available in all UDFs via AbstractRichFunction.getRuntimeContext().

        Specified by:
        withBroadcastSet in interface UdfOperator<IN>
        Parameters:
        data - The data set to be broadcast.
        name - The name under which the broadcast data set retrieved.
        Returns:
        The operator itself, to allow chaining function calls.
      • withForwardedFields

        public O withForwardedFields​(String... forwardedFields)
        Deprecated.
        Adds semantic information about forwarded fields of the user-defined function. The forwarded fields information declares fields which are never modified by the 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 at the same position are specified by their position. The specified position must be valid for the input and output data type and have the same type. For example withForwardedFields("f2") declares that the third field of a Java input tuple 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 reference in the input and the target field reference in the output. withForwardedFields("f0->f2") denotes that the first field of the Java input tuple is unchanged copied to the third field of the Java output tuple. When using a 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 (withForwardedFields("f2; f3->f0; f4")) or separate Strings (withForwardedFields("f2", "f3->f0", "f4")). Please refer to the JavaDoc of Function or Flink's documentation for details on field references such as nested fields and wildcard.

        It is not possible to override existing semantic information about forwarded fields which was for example added by a FunctionAnnotation.ForwardedFields class annotation.

        NOTE: Adding semantic information for functions is optional! If used correctly, semantic information can help the Flink optimizer to generate more efficient execution plans. However, incorrect semantic information can cause the optimizer to generate incorrect execution plans which compute wrong results! So be careful when adding semantic information.

        Parameters:
        forwardedFields - A list of field forward expressions.
        Returns:
        This operator with annotated forwarded field information.
        See Also:
        FunctionAnnotation, FunctionAnnotation.ForwardedFields
      • returns

        public O returns​(Class<OUT> typeClass)
        Deprecated.
        Adds a type information hint about the return type of this operator. This method can be used in cases where Flink cannot determine automatically what the produced type of a function is. That can be the case if the function uses generic type variables in the return type that cannot be inferred from the input type.

        Classes can be used as type hints for non-generic types (classes without generic parameters), but not for generic types like for example Tuples. For those generic types, please use the returns(TypeHint) method.

        Use this method the following way:

        
         DataSet<String[]> result =
             data.flatMap(new FunctionWithNonInferrableReturnType())
                 .returns(String[].class);
         
        Parameters:
        typeClass - The class of the returned data type.
        Returns:
        This operator with the type information corresponding to the given type class.
      • returns

        public O returns​(org.apache.flink.api.common.typeinfo.TypeHint<OUT> typeHint)
        Deprecated.
        Adds a type information hint about the return type of this operator. This method can be used in cases where Flink cannot determine automatically what the produced type of a function is. That can be the case if the function uses generic type variables in the return type that cannot be inferred from the input type.

        Use this method the following way:

        
         DataSet<Tuple2<String, Double>> result =
             data.flatMap(new FunctionWithNonInferrableReturnType())
                 .returns(new TypeHint<Tuple2<String, Double>>(){});
         
        Parameters:
        typeHint - The type hint for the returned data type.
        Returns:
        This operator with the type information corresponding to the given type hint.
      • returns

        public O returns​(org.apache.flink.api.common.typeinfo.TypeInformation<OUT> typeInfo)
        Deprecated.
        Adds a type information hint about the return type of this operator. This method can be used in cases where Flink cannot determine automatically what the produced type of a function is. That can be the case if the function uses generic type variables in the return type that cannot be inferred from the input type.

        In most cases, the methods returns(Class) and returns(TypeHint) are preferable.

        Parameters:
        typeInfo - The type information for the returned data type.
        Returns:
        This operator using the given type information for the return type.
      • getParameters

        public org.apache.flink.configuration.Configuration getParameters()
        Deprecated.
        Description copied from interface: UdfOperator
        Gets the configuration parameters that will be passed to the UDF's open method AbstractRichFunction.open(Configuration). The configuration is set via the UdfOperator.withParameters(Configuration) method.
        Specified by:
        getParameters in interface UdfOperator<IN>
        Returns:
        The configuration parameters for the UDF.
      • getSemanticProperties

        @Internal
        public org.apache.flink.api.common.operators.SingleInputSemanticProperties getSemanticProperties()
        Deprecated.
        Description copied from interface: UdfOperator
        Gets the semantic properties that have been set for the user-defined functions (UDF).
        Specified by:
        getSemanticProperties in interface UdfOperator<IN>
        Returns:
        The semantic properties of the UDF.
      • setSemanticProperties

        @Internal
        public void setSemanticProperties​(org.apache.flink.api.common.operators.SingleInputSemanticProperties properties)
        Deprecated.
        Sets the semantic properties for the user-defined function (UDF). The semantic properties define how fields of tuples and other objects are modified or preserved through this UDF. The configured properties can be retrieved via UdfOperator.getSemanticProperties().
        Parameters:
        properties - The semantic properties for the UDF.
        See Also:
        UdfOperator.getSemanticProperties()
      • getAnalyzedUdfSemanticsFlag

        protected boolean getAnalyzedUdfSemanticsFlag()
        Deprecated.
      • setAnalyzedUdfSemanticsFlag

        protected void setAnalyzedUdfSemanticsFlag()
        Deprecated.
      • extractSemanticAnnotations

        protected org.apache.flink.api.common.operators.SingleInputSemanticProperties extractSemanticAnnotations​(Class<?> udfClass)
        Deprecated.
      • udfWithForwardedFieldsAnnotation

        protected boolean udfWithForwardedFieldsAnnotation​(Class<?> udfClass)
        Deprecated.