All Products
Search
Document Center

DataWorks:ListFunctions

Last Updated:Jun 11, 2026

Mengkueri daftar fungsi yang ditentukan pengguna (UDF) di DataStudio. Anda juga dapat menentukan kondisi filter untuk mengkueri UDF tertentu.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

list

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

ID ruang kerja DataWorks. Anda dapat masuk ke Konsol DataWorks dan membuka halaman Workspace untuk mengkueri ID tersebut.

Anda harus mengonfigurasi parameter ini untuk menentukan ruang kerja DataWorks tempat operasi API diterapkan.

12345

Owner

string

No

ID pemilik UDF. Parameter ini menentukan kondisi filter.

110755000425XXXX

Type

string

No

Tipe fungsi yang ditentukan pengguna (UDF). Parameter ini menentukan kondisi filter.

Nilai valid:

  • Math: fungsi operasi matematika

  • Aggregate: fungsi agregat

  • String: fungsi pemrosesan string

  • Date: fungsi tanggal

  • Analytic: fungsi jendela

  • Other: fungsi lainnya.

Math

Name

string

No

Kriteria filter: nama UDF. Mendukung pencarian fuzzy.

test

PageNumber

integer

No

Nomor halaman. Nilai default: 1. Nilai minimum: 1.

1

PageSize

integer

No

Nomor halaman. Nilai default: 1. Nilai minimum: 1.

10

Elemen respons

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

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

PagingInfo

object

The pagination information.

TotalCount

integer

The total number of entries returned.

294

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries per page.

10

Functions

array<object>

The function list.

array<object>

Information about the elements in the function list.

Name

string

The UDF name.

Function name

CreateTime

integer

The timestamp when the UDF was created.

1655953028000

ProjectId

integer

The ID of the project to which the UDF belongs.

307XXX

Owner

string

The owner of the UDF.

110755000425XXXX

Type

string

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

ModifyTime

integer

The modification time.

1655953028000

ClassName

string

The fully qualified class name of the UDF.

com.demo.Main

ArmResource

string

The list of resource files for the ARM cluster.

xxx.jar,yyy.jar

FileResource

string

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

xxx.jar,yyy.jar

Description

string

The general description of the function.

Description

CommandDescription

string

The command description.

testUdf(xx,yy)

ParameterDescription

string

The parameter description.

xx: parameter information XXX yy: parameter information YYY

ReturnValueDescription

string

The return value description.

The return value is a string.

ExampleDescription

string

The example description.

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

EmbeddedCodeType

string

The nested code type.

Valid values:

  • Python2

  • Python3

  • Java8

  • Java11

  • Java17

Python2

EmbeddedResourceType

string

The nested resource type.

Valid values:

  • File: General resource file.

  • Embedded: Embedded resource.

File

EmbeddedCode

string

Content of the nested function code

print('hello,world!')

DatabaseName

string

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

EMR_lake

DataSource

object

Data source information of the UDF.

Name

string

The name of the data source.

odps_first

Type

string

The type of the data source.

odps

Script

object

Script information of the UDF.

Path

string

The script path.

XXX/OpenAPI/function/function_name

Runtime

object

Runtime

Command

string

Command

ODPS_FUNCTION

Id

string

The ID of the script.

Catatan

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

RuntimeResource

object

The runtime resource group information.

ResourceGroupId

string

The runtime resource group ID.

S_resgrop_xxx

Id

string

The unique identifier of the UDF.

Catatan

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

Contoh

Respons sukses

JSONformat

{
  "RequestId": "89FB2BF0-EB00-5D03-9C34-05931001XXXX",
  "PagingInfo": {
    "TotalCount": 294,
    "PageNumber": 1,
    "PageSize": 10,
    "Functions": [
      {
        "Name": "Function name",
        "CreateTime": 1655953028000,
        "ProjectId": 0,
        "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": "EMR_lake",
        "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"
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.