All Products
Search
Document Center

DataWorks:ListFunctions

Last Updated:Dec 11, 2024

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

There is currently no authorization information disclosed in the API.

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 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: others
Enumeration Value:
  • Analytic: Analytic.
  • String: String.
  • Math: Math.
  • Aggregate: Aggregate.
  • Date: Date.
  • Other: Other.
MATH
PageNumberintegerNo

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

1
PageSizeintegerNo

The number of entries per page. Default value: 10. Maximum value: 100.

10

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

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 UDFs.

functionobject

The information about the UDF.

Idstring

The ID of the UDF.

580667964888595XXXX
Namestring

The name of the UDF.

CreateTimelong

The time when the UDF was created. This value is a UNIX timestamp.

1655953028000
ProjectIdstring

The ID of the workspace to which the UDF belongs.

307XXX
Ownerstring

The owner of the UDF.

110755000425XXXX
Typestring

The UDF type.

Valid values:

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

The time when the UDF was last modified. This value is a UNIX timestamp.

1655953028000
ClassNamestring

The fully qualified class name of the UDF.

com.demo.Main
ArmResourcestring

The file resources in an Advanced RISC Machines (ARM) cluster.

xxx.jar,yyy.jar
FileResourcestring

The files resources.

xxx.jar,yyy.jar
Descriptionstring

The overall description of the UDF.

CommandDescriptionstring

The description of the command.

testUdf(xx,yy)
ParameterDescriptionstring

The description of the parameter.

ReturnValueDescriptionstring

The description of the return value.

ExampleDescriptionstring

The description of the example.

EmbeddedCodeTypestring

The type of the nested code.

Valid values:

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

The type of the nested resource.

Valid values:

  • File: general resources
  • Embedded: embedded resources
File
EmbeddedCodestring

The code of the embedded UDF.

print('hello,world!')
DatabaseNamestring

The name of the database. This parameter is returned for E-MapReduce (EMR) functions.

odps_first
DataSourceobject

The data source information about the UDF.

Namestring

The name of the data source.

odps_first
Typestring

The type of the data source.

odps
Scriptobject

The script information about the UDF.

Pathstring

The script path.

Runtimeobject

The runtime.

Commandstring

The command.

ODPS_FUNCTION
Idstring

The script ID.

652567824470354XXXX
RuntimeResourceobject

The information about the resource group used when you run the UDF.

ResourceGroupIdstring

The ID of the resource group used when you run the UDF.

S_resgrop_xxx

Examples

Sample success responses

JSONformat

{
  "RequestId": "89FB2BF0-EB00-5D03-9C34-05931001XXXX",
  "PagingInfo": {
    "TotalCount": 294,
    "PageNumber": 1,
    "PageSize": 10,
    "Functions": [
      {
        "Id": "580667964888595XXXX",
        "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": "",
        "CommandDescription": "testUdf(xx,yy)",
        "ParameterDescription": "",
        "ReturnValueDescription": "",
        "ExampleDescription": "",
        "EmbeddedCodeType": "Python2",
        "EmbeddedResourceType": "File",
        "EmbeddedCode": "print('hello,world!')",
        "DatabaseName": "odps_first",
        "DataSource": {
          "Name": "odps_first",
          "Type": "odps"
        },
        "Script": {
          "Path": "",
          "Runtime": {
            "Command": "ODPS_FUNCTION"
          },
          "Id": "652567824470354XXXX"
        },
        "RuntimeResource": {
          "ResourceGroupId": "S_resgrop_xxx"
        }
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history