Managing Variables
Scenarios
FlinkServer supports user-defined variables in SQL jobs. You can create and use these variables to replace constant values in the WITH clause of table creation statements.
Notes and Constraints
- Variables are supported only in SQL jobs and specifically within the WITH clause of table creation statements.
- Variables apply only to the current application. They cannot be shared across different applications.
- Private variables can be viewed, edited, used, or deleted only by their creator.
- The plaintext value of a ciphertext variable is hidden and cannot be viewed.
- This section applies to MRS 3.6.0-LTS.1 and later.
Creating a Variable
- Access the Flink web UI. For details, see Accessing the FlinkServer Web UI.
- Choose System Management > Variable Management.
- Click Add Variable, enter variable information by referring to Table 1, and click OK.
Table 1 Variable information Parameter
Description
Variable
Name and value of a variable.
Type
Ciphertext or plaintext. The value of a ciphertext variable is hidden and displayed as asterisks (******).
Application Scope
Private or public.
- Public variables can be viewed, edited, used, or deleted by any authorized user.
- Private variables can be viewed, edited, used, or deleted only by their creator.
If the variable type is encrypted Text, we recommend that you set the application scope to private.
Description
Variable description.
- Once a variable is created, use it in the WITH clause of a table creation statement in an SQL job. The following is an example:
CREATE TABLE MyUserTable( c_customer_sk INTEGER, c_customer_name VARCHAR(32) ) WITH( 'connector' = 'jdbc', 'url' = '${url}', 'table-name' = 'customer_t1', 'username' = '${user}', 'password' = '${password}' );
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot