Interface UDTF

    • Method Detail

      • beforeStart

        void beforeStart​(UDFParameters parameters,
                         UDTFConfigurations configurations)
                  throws java.lang.Exception
        This method is mainly used to customize UDTF. In this method, the user can do the following things:
        • Use UDFParameters to get the time series paths and parse key-value pair attributes entered by the user.
        • Set the strategy to access the original data and set the output data type in UDTFConfigurations.
        • Create resources, such as establishing external connections, opening files, etc.

        This method is called after the UDTF is instantiated and before the beginning of the transformation process.

        Parameters:
        parameters - used to parse the input parameters entered by the user
        configurations - used to set the required properties in the UDTF
        Throws:
        java.lang.Exception - the user can throw errors if necessary
      • transform

        default void transform​(Row row,
                               PointCollector collector)
                        throws java.lang.Exception
        When the user specifies RowByRowAccessStrategy to access the original data in UDTFConfigurations, this method will be called to process the transformation. In a single UDF query, this method may be called multiple times.
        Parameters:
        row - original input data row (aligned by time)
        collector - used to collect output data points
        Throws:
        java.lang.Exception - the user can throw errors if necessary
        See Also:
        RowByRowAccessStrategy
      • transform

        default java.lang.Object transform​(Row row)
                                    throws java.lang.Exception
        When the user specifies MappableRowByRowAccessStrategy to access the original data in UDTFConfigurations, this method will be called to process the transformation. In a single UDF query, this method may be called multiple times.
        Parameters:
        row - original input data row (aligned by time)
        Throws:
        java.lang.Exception - the user can throw errors if necessary
        See Also:
        MappableRowByRowAccessStrategy