All Products
Search
Document Center

DataWorks:CreateUdfFile

Last Updated:Jan 12, 2026

Creates a file for a function in DataStudio.

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
FileFolderPathstringYes

The path to the folder containing the function file.

Business_process/First_Business_Process/function/string_processing
ProjectIdlongNo

The DataWorks workspace ID. To find this, click the wrench icon in the upper-right corner and navigate to the workspace management page.

10000
FileNamestringYes

The function name.

StringConcat
FunctionTypestringYes

The function category, corresponding to the function type field in the Create Function form. Valid values: MATH (mathematical functions), AGGREGATE (aggregate functions), STRING (string processing functions), DATE (date processing functions), ANALYTIC (window functions), and OTHER (other functions).

STRING
ClassNamestringYes

The class name where the function is defined, corresponding to the class name field in the Create Function form.

com.alibaba.DataWorks.api.udf.StringConcat
ResourcesstringYes

A comma-separated list of resource names referenced by the function, corresponding to the resource list field in the Create Function form.

string-concat-1.0.0.jar,commons-lang-2.6.jar
UdfDescriptionstringYes

The function purpose description, corresponding to the description field in the Create Function form.

Concatenate several strings to generate a new string
CmdDescriptionstringNo

The command format for invoking the function, corresponding to the command format field in the Create Function form.

StringConcat(String... substrs)
ParameterDescriptionstringNo

The function parameter description, corresponding to the parameter description field in the Create Function form.

List of strings to be connected
ReturnValuestringNo

The return value description, corresponding to the return value field in the Create Function form.

New strings generated by concatenating all strings before and after the input order
ExamplestringNo

An example demonstrating how to call the function, corresponding to the example field in the Create Function form.

StringConcat('a', 'b', 'c')
ProjectIdentifierstringNo

The unique identifier of the DataWorks workspace, which is the identifier at the top of the Data Studio page where you switch workspaces.

dw_project
CreateFolderIfNotExistsbooleanNo

Specifies whether to automatically create the directory if the specified path (FileFolderPath) does not exist. Valid values:

  • true: Automatically creates the directory if it does not exist.
  • false: The call fails if the directory does not exist.
false

Response parameters

ParameterTypeDescriptionExample
object

The response.

HttpStatusCodeinteger

The HTTP status code.

200
Datalong

The file ID after successful creation.

100000002
RequestIdstring

The unique ID for this request. Use this ID for troubleshooting if an error occurs.

0000-ABCD-EFG****
ErrorMessagestring

The error message.

The connection does not exist.
Successboolean

Indicates whether the request succeeded.

  • true
  • false
true
ErrorCodestring

The error code.

Invalid.Tenant.ConnectionNotExists

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "Data": 100000002,
  "RequestId": "0000-ABCD-EFG****",
  "ErrorMessage": "The connection does not exist.",
  "Success": true,
  "ErrorCode": "Invalid.Tenant.ConnectionNotExists"
}

Error codes

HTTP status codeError codeError messageDescription
403Forbidden.AccessAccess is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.No permission, please authorize
429Throttling.ApiThe request for this resource has exceeded your available limit.-
429Throttling.SystemThe DataWorks system is busy. Try again later.-
429Throttling.UserYour request is too frequent. Try again later.-
500InternalError.SystemAn internal system error occurred. Try again later.-
500InternalError.UserId.MissingAn internal system error occurred. Try again later.-

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