文档

CreateUdfFile

更新时间:

调用CreateUdfFile,在数据开发中创建函数类型文件。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String CreateUdfFile

系统规定参数。取值:CreateUdfFile

FileFolderPath String 业务流程/第一个业务流程/函数/字符串处理

函数文件所在的文件夹路径。

ProjectId Long 10000

DataWorks工作空间的ID,您可以单击页面右上角的小扳手图标,进入工作空间管理页面查看。

FileName String StringConcat

函数的名称。

FunctionType String STRING

函数的分类,对应创建函数表单中的函数类型一项,包括MATH(数学运算函数)、AGGREGATE(聚合函数)、STRING(字符串处理函数)、DATE(日期处理函数)、ANALYTIC(窗口函数)和OTHER(其他函数)。

ClassName String com.alibaba.DataWorks.api.udf.StringConcat

函数定义所在的类名,对应创建函数表单的类名一项。

Resources String string-concat-1.0.0.jar,commons-lang-2.6.jar

函数引用的资源名列表,对应创建表中的资源列表。多个资源名称之间使用英文逗号(,)分隔。

UdfDescription String 把几个字符串连接起来生成一个新的字符串

函数用途的说明,对应创建函数表单中的描述。

CmdDescription String StringConcat(String... substrs)

函数调用的命令格式,对应创建函数表单中的命令格式。

ParameterDescription String 需要连接的字符串列表

函数入参的说明,对应创建函数表单中的参数说明。

ReturnValue String 所有字符串按照输入顺序前后连接生成的新字符串

函数的返回值说明,对应创建函数表单中的返回值。

Example String StringConcat('a', 'b', 'c')

函数调用示例,对应创建函数表单中的示例。

ProjectIdentifier String dw_project

DataWorks工作空间的唯一标识符,即数据开发页面顶部切换工作空间处的英文标识。展开详情

CreateFolderIfNotExists Boolean false

当参数中指定的目录(FileFolderPath)在系统中不存在时,是否自动创建此目录。取值如下:

true:若此目录不存在,自动创建此目录

false:若此目录不存在,调用失败

返回数据

名称

类型

示例值

描述

HttpStatusCode Integer 200

HTTP状态码。

Data Long 100000002

文件创建成功后的ID。

RequestId String 0000-ABCD-EFG****

本次调用的唯一ID。出现错误后,您可以根据该ID排查问题。

ErrorMessage String The connection does not exist.

错误信息。

Success Boolean true

调用是否成功。

ErrorCode String Invalid.Tenant.ConnectionNotExists

错误码。

示例

请求示例

http(s)://[Endpoint]/?Action=CreateUdfFile
&FileFolderPath=业务流程/第一个业务流程/函数/字符串处理
&ProjectId=10000
&FileName=StringConcat
&FunctionType=STRING
&ClassName=com.alibaba.DataWorks.api.udf.StringConcat
&Resources=string-concat-1.0.0.jar,commons-lang-2.6.jar
&UdfDescription=把几个字符串连接起来生成一个新的字符串
&CmdDescription=StringConcat(String... substrs)
&ParameterDescription=需要连接的字符串列表
&ReturnValue=所有字符串按照输入顺序前后连接生成的新字符串
&Example=StringConcat('a', 'b', 'c')
&ProjectIdentifier=dw_project
&CreateFolderIfNotExists=false
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateUdfFileResponse>
    <RequestId>0000-ABCD-EFG****</RequestId>
    <HttpStatusCode>200</HttpStatusCode>
    <Data>100000002</Data>
    <Success>true</Success>
</CreateUdfFileResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "0000-ABCD-EFG****",
  "HttpStatusCode" : 200,
  "Data" : 100000002,
  "Success" : true
}

错误码

HttpCode

错误码

错误信息

描述

429 Throttling.Api The request for this resource has exceeded your available limit. 对该资源的请求已超过您的可用上限。
429 Throttling.System The DataWorks system is busy. Try again later. DataWorks系统繁忙,请稍后再试。
429 Throttling.User Your request is too frequent. Try again later. 您的请求过于频繁,请尝试放缓请求速度。
500 InternalError.System An internal system error occurred. Try again later. 系统内部错误,请稍后再试。
500 InternalError.UserId.Missing An internal system error occurred. Try again later. 系统内部错误,请稍后再试。

访问错误中心查看更多错误码。

  • 本页导读 (1)
文档反馈