Configuring a Template
This section describes how to create and use a Flink SQL template. When writing Flink SQL code, you can use an SQL template for repeated service logic. In addition, you can use a job parameter template when configuring job parameters.
Constraints
This function applies to the following scenarios:
- Use a script template for a Flink SQL script.
- During pipeline job development, use a Fink SQL script which uses a script template for the MRS Flink Job node and use a parameter template for Program Parameter of the MRS Flink Job node.
- Use a script template in a single-task Flink SQL job.
- Use template parameters in a single-task Flink JAR job.
- You can use parameter templates for Spark SQL and Hive SQL scripts and single-task jobs. For details about how to use a template, see Configuring a Default Item.
Procedure
- Log in to the DataArts Studio console by following the instructions in Accessing the DataArts Studio Instance Console.
- On the DataArts Studio console, locate a workspace and click DataArts Factory.
- In the navigation pane, choose .
- Choose Templates.
- Create a script template.
- On the Script Templates page, click Add.
- Set Template Name.
- Enter an SQL statement and reference script parameters.
- Configure the script template parameters. The parameter names cannot be changed, and the parameter values can be changed.
Figure 1 Creating a script template
- Click Save.
You can view, modify, or delete the created script template.
- Create a parameter template.
- On the Parameter Templates page, click Add.
- Set Template Name.
- Click Add Parameter Set parameter names and values. You can modify or delete parameters.
Figure 2 Creating a parameter template
- Click OK.
You can view, modify, or delete the created parameter template.
For details about the application scenarios of script templates and parameter templates, see Using Script Templates and Parameter Templates.
- Create a script template.
Feedback
Was this page helpful?
Provide feedbackThank 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