DLI allows you to set variables that are frequently used during job development as global variables on the DLI management console. This avoids repeated definitions during job editing and reduces development and maintenance costs. Global variables can be used to replace long and difficult variables, simplifying complex parameters and improving the readability of SQL statements.
This section describes how to create a global variable.
Parameter | Description |
|---|---|
Variable | Name of the created global variable. |
Value | Global variable value. |
create table {{table_name}} (String1 String, int4 int, varchar1 varchar(10))partitioned by (int1 int,int2 int,int3 int)
Do not use global variables in OPTIONS of the table creation statements.
Related operations:
On the Global Variables page, locate a desired variable and click Modify in the Operation column.
If there are multiple global variables with the same name in the same project under an account, delete the redundant global variables to ensure that the global variables are unique in the same project. In this case, all users who have the permission to modify the global variables can change the variable values.
On the Global Variables page, click Delete in the Operation column of a variable to delete the variable value.
You can assign different users different global variables through permission settings. The administrator and owners of global variables have all permissions. You do not need to set permissions for them, and their global variable permissions cannot be modified by other users.
When setting global variables for a new user, the user's group must have the Tenant Guest permission.
Parameter | Description |
|---|---|
Username | Name of the IAM user who is granted permissions NOTE: This username must be an existing IAM username. |
Permissions |
|
On the User Permissions page, locate a desired IAM user and click Set Permission in the Operation column. Table 2 lists the permission parameters.
If all permission options are grayed out, it means you do not have the authority to modify the permissions on this global variable. You can request the modification permission from users who have authorization, such as the administrator or group owners.
On the User Permissions page, locate a desired IAM user and click Revoke Permission in the Operation column. Once the revoke operation is complete, the IAM user will no longer have any permissions on the global variable.