Class ExampleUserDefinedFunctionHandler
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.handlers.UserDefinedFunctionHandler
-
- com.amazonaws.athena.connector.lambda.examples.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 extendsUserDefinedFunctionHandlerand copy-paste codes as needed.
-
-
Constructor Summary
Constructors Constructor Description ExampleUserDefinedFunctionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringconcatenate(List<String> list)This UDF takes in a list of String as input, concatenate every element in the list and returns.Longget_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.Integermultiply(Integer factor1, Integer factor2)This UDF takes 2 integers, returns the produce of the 2 integers.Stringto_json(Map<String,Object> struct)This UDF writes the complext struct type value to Json string.-
Methods inherited from class com.amazonaws.athena.connector.lambda.handlers.UserDefinedFunctionHandler
doHandleRequest, handleRequest, onPing, processRows
-
-
-
-
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
-
-