All Products
Search
Document Center

DataWorks:ListFunctions

Last Updated:Jan 12, 2026

Queries a list of user-defined functions (UDFs) in DataStudio. You can also specify filter conditions to query specific UDFs.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dataworks:*list
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdstringYes

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID.

You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

12345
OwnerstringNo

The ID of the owner of the UDF. This parameter specifies a filter condition.

110755000425XXXX
TypestringNo

The user-defined function (UDF) type. This parameter specifies a filter condition.

Valid values:

  • Math: mathematical operation function
  • Aggregate: aggregate function
  • String: string processing function
  • Date: date function
  • Analytic: window function
  • Other: other functions
MATH
NamestringNo

Filter criteria: UDF name. Supports fuzzy search.

test
PageNumberintegerNo

The page number. Default value: 1. Minimum value: 1.

1
PageSizeintegerNo

The page number. Default value: 1. Minimum value: 1.

10

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

89FB2BF0-EB00-5D03-9C34-05931001XXXX
PagingInfoobject

The pagination information.

TotalCountinteger

The total number of entries returned.

294
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
Functionsarray<object>

The function list.

functionobject

Information about the elements in the function list.

Namestring

The UDF name.

Function name
CreateTimelong

The timestamp when the UDF was created.

1655953028000
ProjectIdstring

The ID of the project to which the UDF belongs.

307XXX
Ownerstring

The owner of the UDF.

110755000425XXXX
Typestring

The UDF type.

Valid values:

  • Math: Mathematical operation functions
  • Aggregate: Aggregation functions
  • String: String processing functions
  • Date: Date functions
  • Analytic: Window functions
  • Other: Other functions
MATH
ModifyTimelong

The modification time.

1655953028000
ClassNamestring

The fully qualified class name of the UDF.

com.demo.Main
ArmResourcestring

The list of resource files for the ARM cluster.

xxx.jar,yyy.jar
FileResourcestring

The implementation code of the function and the list of resource files.

xxx.jar,yyy.jar
Descriptionstring

The general description of the function.

Description
CommandDescriptionstring

The command description.

testUdf(xx,yy)
ParameterDescriptionstring

The parameter description.

xx: parameter information XXX yy: parameter information YYY
ReturnValueDescriptionstring

The return value description.

The return value is a string.
ExampleDescriptionstring

The example description.

Example description >>> select tsetUdf(xx,yy); abc
EmbeddedCodeTypestring

The nested code type.

Valid values:

  • Python2
  • Python3
  • Java8
  • Java11
  • Java17
Python2
EmbeddedResourceTypestring

The nested resource type.

Valid values:

  • File: General resource file.
  • Embedded: Embedded resource.
File
EmbeddedCodestring

Content of the nested function code

print('hello,world!')
DatabaseNamestring

The database name. This parameter is used only when the function type is EMR Function.

odps_first
DataSourceobject

Data source information of the UDF.

Namestring

The name of the data source.

odps_first
Typestring

The type of the data source.

odps
Scriptobject

Script information of the UDF.

Pathstring

The script path.

XXX/OpenAPI/function/function_name
Runtimeobject

Runtime

Commandstring

Command

ODPS_FUNCTION
Idstring

The ID of the script.

Note This field is of type Long in SDK versions prior to 8.0.0, and of type String in SDK version 8.0.0 and later. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. However, compilation failures may occur due to the type change only when upgrading the SDK across version 8.0.0. In this case, you must manually update the data type.
652567824470354XXXX
RuntimeResourceobject

The runtime resource group information.

ResourceGroupIdstring

The runtime resource group ID.

S_resgrop_xxx
Idstring

The unique identifier of the UDF.

Note Prior to SDK version 8.0.0, this field is of type Long. In SDK version 8.0.0 and later, it is of type String. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type.
580667964888595XXXX

Examples

Sample success responses

JSONformat

{
  "RequestId": "89FB2BF0-EB00-5D03-9C34-05931001XXXX",
  "PagingInfo": {
    "TotalCount": 294,
    "PageNumber": 1,
    "PageSize": 10,
    "Functions": [
      {
        "Name": "Function name",
        "CreateTime": 1655953028000,
        "ProjectId": "307XXX",
        "Owner": "110755000425XXXX",
        "Type": "MATH",
        "ModifyTime": 1655953028000,
        "ClassName": "com.demo.Main",
        "ArmResource": "xxx.jar,yyy.jar",
        "FileResource": "xxx.jar,yyy.jar",
        "Description": "Description",
        "CommandDescription": "testUdf(xx,yy)",
        "ParameterDescription": "xx: parameter information XXX\nyy: parameter information YYY",
        "ReturnValueDescription": "The return value is a string.",
        "ExampleDescription": "Example description >>> select tsetUdf(xx,yy);\nabc",
        "EmbeddedCodeType": "Python2",
        "EmbeddedResourceType": "File",
        "EmbeddedCode": "print('hello,world!')",
        "DatabaseName": "odps_first",
        "DataSource": {
          "Name": "odps_first",
          "Type": "odps"
        },
        "Script": {
          "Path": "XXX/OpenAPI/function/function_name",
          "Runtime": {
            "Command": "ODPS_FUNCTION"
          },
          "Id": "652567824470354XXXX"
        },
        "RuntimeResource": {
          "ResourceGroupId": "S_resgrop_xxx"
        },
        "Id": "580667964888595XXXX"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-12-29The response structure of the API has changedView Change Details
2025-01-13The response structure of the API has changedView Change Details