tencent cloud

Feedback

CREATE FUNCTION

Last updated: 2024-08-07 17:24:25

    Description

    Supported engines: Presto and SparkSQL Purpose: Create a function that is implemented by the class name.

    Statement

    CREATE FUNCTION [db_name.]function_name AS class_name
    [USING JAR|FILE|ARCHIVE 'file_uri' [, JAR|FILE|ARCHIVE 'file_uri'] ];
    
    -- A function with the suffix name of _udtf will be recognized as a UDTF function.
    CREATE FUNCTION [db_name].function_udtf AS class_name
    [USING JAR|FILE|ARCHIVE 'file_uri' [, JAR|FILE|ARCHIVE 'file_uri'] ];

    Parameter

    [db_name.]function_name: Function name. The namespace is specified to be in the database represented by db_name during function creation.
    class_name: Implementation class of the function.
    USING JAR|FILE|ARCHIVE 'file_uri': Path to resources used for function creation.

    Example

    CREATE FUNCTION `MYFUNC` AS 'myclass' USING JAR 'hdfs:///path/to/jar'
    
    CREATE FUNCTION `MYFUNC` AS 'myclass' USING JAR 'hdfs:///path/to/jar', FILE 'file:///usr/local/'
    
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support