Interface Filter

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()
      Tear-down method for the user code.
      boolean filter​(KastRow kRow)
      The filter function that evaluates the predicate.
      org.apache.avro.Schema getProducedType​(org.apache.avro.Schema schema)
      Declare the data type information of the data produced by your function.
      default void open​(Map<String,​String> configuration, org.apache.avro.Schema schema)
      Initialization method for the function.
      default void open​(Map<String,​String> configuration, org.apache.avro.Schema schema, Map<String,​Object> meta)
      Initialization method for the function.
    • Method Detail

      • filter

        boolean filter​(KastRow kRow)
                throws Exception
        The filter function that evaluates the predicate.

        IMPORTANT: The system assumes that the function does not modify the elements on which the predicate is applied. Violating this assumption can lead to incorrect results.

        Parameters:
        kRow - The value to be filtered.
        Returns:
        True for values that should be retained, false for values to be filtered out.
        Throws:
        Exception - This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
      • getProducedType

        org.apache.avro.Schema getProducedType​(org.apache.avro.Schema schema)
        Declare the data type information of the data produced by your function.
        Parameters:
        schema - the input row schema
        Returns:
        the produced data typeInfo
      • open

        default void open​(Map<String,​String> configuration,
                          org.apache.avro.Schema schema)
                   throws Exception
        Initialization method for the function.
        Parameters:
        configuration - The configuration containing the parameters attached to the contract
        schema - the input row schema
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • open

        default void open​(Map<String,​String> configuration,
                          org.apache.avro.Schema schema,
                          Map<String,​Object> meta)
                   throws Exception
        Initialization method for the function.
        Parameters:
        configuration - The configuration containing the parameters attached to the contract
        schema - the input row schema
        meta - the udf configuration parameters
        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.
      • close

        default void close()
                    throws Exception
        Tear-down method for the user code. It is called after the last call to the main working methods. For functions that are part of an iteration, this method will be invoked after each iteration superstep.

        This method can be used for clean up work.

        Throws:
        Exception - The function may throw exceptions which cause the streaming program to fail and go into recovery.