This topic describes how to create a Realtime Compute job and the features provided on the Development page, such as syntax check, Flink SQL code assistance, and management of Flink SQL code versions.
- Log on to the Realtime Compute development platform.
- In the top navigation bar, click Development.
- On the Development page that appears, click Create File at the top.
- In the Create File dialog box that appears, set relevant parameters. The following table describes these
Parameter Description File Name The name of the file that contains the Fink SQL code.Note The file name must be unique in the current project. File Type
- For Realtime Compute in shared mode, the valid value is FLINK_STREAM/SQL.
- For Realtime Compute in exclusive mode, valid values are FLINK_STREAM/DATASTREAM and FLINK_STREAM/SQL.
Storage Path The folder of the file that contains the Fink SQL code. You can click the icon on the right side of an existing folder to create a subfolder.
- Click OK. On the page that appears, you can edit the Flink SQL code.
- On the right side of the Development page, you can click Code Structure to check the Flink SQL code structure.
- We recommend that you click Storage to manage upstream and downstream storage resources. For more information, see Overview.
- When you save a Flink SQL job, the system automatically checks the syntax.
- Syntax check only takes effect for Flink SQL statements with complete logic.
You can click Parameters on the right side of the Development page to set job parameters. For more information about job parameters, see Job parameters.
Flink SQL code assistance
- Syntax check
After you modify the Flink SQL code, the system automatically saves it and checks its syntax. If a syntax error is detected, the system displays the cause of the error and the row and column where the error is located on the Development page.
- Intelligent code completion
When you enter Flink SQL statements on the Development page, the system automatically completes keywords, built-in functions, tables, or fields.
- Syntax highlighting
The system highlights keywords in Flink SQL statements and displays different structures in different colors.
Management of Flink SQL code versions
On the Development page, you can manage Flink SQL code versions. A new code version is generated each time you publish a job. You can use code versions to track versions, modify the code, and roll the code back to an earlier version.
- Compare: checks the difference between the current version and an earlier version.
- Rollback: rolls the code back to an earlier version.
- Delete: deletes a code version. By default, you can reserve a maximum of 20 Flink SQL code
versions in Realtime Compute. If the number of code versions is less than 20, you
can publish a job. If the number of code versions is 20, the system does not allow
you to publish a job and prompts you to delete earlier versions.
Note You can publish a job only if the number of versions is less than 20.
- Locked: locks the current version.
Note You cannot submit a new version before you unlock the current version.