调用CreateUdfFile,在数据开发中创建函数类型文件。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| FileFolderPath |
string |
否 |
函数文件所在的文件夹路径。 |
Business_process/First_Business_Process/function/string_processing |
| ProjectId |
integer |
否 |
DataWorks 工作空间的 ID,您可以单击页面右上角的小扳手图标,进入工作空间管理页面查看。 |
10000 |
| FileName |
string |
是 |
函数的名称。 |
StringConcat |
| FunctionType |
string |
是 |
函数的分类,对应创建函数表单中的函数类型一项,包括 MATH(数学运算函数)、AGGREGATE(聚合函数)、STRING(字符串处理函数)、DATE(日期处理函数)、ANALYTIC(窗口函数)和 OTHER(其他函数)。 枚举值:
|
STRING |
| ClassName |
string |
是 |
函数定义所在的类名,对应创建函数表单的类名一项。 |
com.alibaba.DataWorks.api.udf.StringConcat |
| Resources |
string |
是 |
函数引用的资源名列表,对应创建表中的资源列表。多个资源名称之间使用英文逗号(,)分隔。 |
string-concat-1.0.0.jar,commons-lang-2.6.jar |
| UdfDescription |
string |
否 |
函数用途的说明,对应创建函数表单中的描述。 |
Concatenate several strings to generate a new string |
| CmdDescription |
string |
否 |
函数调用的命令格式,对应创建函数表单中的命令格式。 |
StringConcat(String... substrs) |
| ParameterDescription |
string |
否 |
函数入参的说明,对应创建函数表单中的参数说明。 |
List of strings to be connected |
| ReturnValue |
string |
否 |
函数的返回值说明,对应创建函数表单中的返回值。 |
New strings generated by concatenating all strings before and after the input order |
| Example |
string |
否 |
函数调用示例,对应创建函数表单中的示例。 |
StringConcat('a', 'b', 'c') |
| ProjectIdentifier |
string |
否 |
DataWorks 工作空间的唯一标识符,即数据开发页面顶部切换工作空间处的英文标识。 |
dw_project |
| CreateFolderIfNotExists |
boolean |
否 |
当参数中指定的目录(FileFolderPath)在系统中不存在时,是否自动创建此目录。取值如下:
|
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| Data |
integer |
文件创建成功后的 ID。 |
100000002 |
| RequestId |
string |
本次调用的唯一 ID。出现错误后,您可以根据该 ID 排查问题。 |
0000-ABCD-EFG**** |
| ErrorMessage |
string |
错误信息。 |
The connection does not exist. |
| Success |
boolean |
调用是否成功。 |
true |
| ErrorCode |
string |
错误码。 |
Invalid.Tenant.ConnectionNotExists |
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"Data": 100000002,
"RequestId": "0000-ABCD-EFG****",
"ErrorMessage": "The connection does not exist.",
"Success": true,
"ErrorCode": "Invalid.Tenant.ConnectionNotExists"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 500 | InternalError.System | An internal system error occurred. Try again later. | |
| 500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | |
| 403 | Forbidden.Access | Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. | 没有权限,请授权 |
| 429 | Throttling.Api | The request for this resource has exceeded your available limit. | |
| 429 | Throttling.System | The DataWorks system is busy. Try again later. | |
| 429 | Throttling.User | Your request is too frequent. Try again later. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。