Class ExampleUserDefinedFunctionHandler

  • All Implemented Interfaces:
    com.amazonaws.services.lambda.runtime.RequestStreamHandler

    public class ExampleUserDefinedFunctionHandler
    extends UserDefinedFunctionHandler
    Example user-defined-handler that demonstrates how to write user defined functions. We don't recommend that you use this class directly. Instead, please create new classes that extends UserDefinedFunctionHandler and copy-paste codes as needed.
    • Constructor Detail

      • ExampleUserDefinedFunctionHandler

        public ExampleUserDefinedFunctionHandler()
    • Method Detail

      • multiply

        public Integer multiply​(Integer factor1,
                                Integer factor2)
        This UDF takes 2 integers, returns the produce of the 2 integers.
        Parameters:
        factor1 -
        factor2 -
        Returns:
        product
      • concatenate

        public String concatenate​(List<String> list)
        This UDF takes in a list of String as input, concatenate every element in the list and returns.
        Parameters:
        list -
        Returns:
      • to_json

        public String to_json​(Map<String,​Object> struct)
        This UDF writes the complext struct type value to Json string.
        Parameters:
        struct -
        Returns:
        Json string of the struct object
      • get_default_value_if_null

        public Long get_default_value_if_null​(Long value)
        This UDF takes in a Long value, and returns a default value if the input value is not set.
        Parameters:
        value -
        Returns:
        original value or 0 if value is not set (null)