Todos os produtos
Search
Central de documentação

DataWorks:ListFunctions

Última atualização: Jun 26, 2026

Consulta uma lista de funções definidas pelo usuário (UDFs) no DataStudio. Você também pode especificar condições de filtro para consultar UDFs específicas.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

Ação

Nível de acesso

Tipo de recurso

Chave de condição

Ação dependente

dataworks:*

list

*All Resource

*

Nenhuma Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

ProjectId

integer

Sim

O ID do espaço de trabalho do DataWorks. Você pode fazer logon no console do DataWorks e acessar a página Espaço de Trabalho para consultar o ID.

Você deve configurar este parâmetro para especificar o espaço de trabalho do DataWorks ao qual a operação de API é aplicada.

12345

Owner

string

Não

O ID do proprietário da UDF. Este parâmetro especifica uma condição de filtro.

110755000425XXXX

Type

string

Não

O tipo de função definida pelo usuário (UDF). Este parâmetro especifica uma condição de filtro.

Valores válidos:

  • Math: função de operação matemática

  • Aggregate: função de agregação

  • String: função de processamento de string

  • Date: função de data

  • Analytic: função de janela

  • Other: outras funções.

Math

Name

string

Não

Critérios de filtro: nome da UDF. Suporta pesquisa aproximada.

test

PageNumber

integer

Não

O número da página. Valor padrão: 1. Valor mínimo: 1.

1

PageSize

integer

Não

O número da página. Valor padrão: 1. Valor mínimo: 1.

10

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

Esquema da resposta.

RequestId

string

O ID da solicitação.

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

PagingInfo

object

As informações de paginação.

TotalCount

integer

O número total de entradas retornadas.

294

PageNumber

integer

O número da página.

1

PageSize

integer

O número de entradas por página.

10

Functions

array<object>

A lista de funções.

array<object>

Informações sobre os elementos na lista de funções.

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.

Nota

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.

Nota

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

Exemplos

Resposta de sucesso

JSON formato

{
  "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"
      }
    ]
  }
}

Códigos de erro

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.