DLI позволяет устанавливать переменные, которые часто используются при разработке заданий, в виде глобальных переменных в консоли управления DLI. Это избавляет от повторных определений при редактировании заданий и снижает затраты на разработку и обслуживание. Глобальные переменные можно использовать для замены длинных и сложных переменных, упрощая сложные параметры и повышая читаемость SQL‑запросов.
В этом разделе описывается, как создать глобальную переменную.
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 столбец. Таблица 2 перечисляет параметры разрешений.
Если все параметры разрешений неактивны (серого цвета), это означает, что у вас нет прав изменять разрешения для этой глобальной переменной. Вы можете запросить разрешение на изменение у пользователей, имеющих авторизацию, например у администратора или владельцев группы.
В Разрешения пользователя странице, найдите нужного пользователя IAM и нажмите Отозвать разрешение в Операция столбец. После завершения операции отзыва пользователь IAM более не будет иметь никаких разрешений на глобальную переменную.