Every time you deploy a draft, the system creates a draft version. You can use draft versions to compare changes between iterations, restore a previous version, pin a version to prevent automatic deletion, or delete versions you no longer need.
The system supports a maximum of 50 draft versions. When this limit is exceeded, the earliest version is automatically deleted.
Operations
The Draft Versions panel in the SQL editor supports the following operations:
Operation | Description |
View a side-by-side diff of SQL code and deployment configurations between two versions. Differences are highlighted. | |
Restore a deployed draft to a previous version. | |
Pin a version to protect it from automatic deletion. | |
Delete a draft version. |
Common steps
Steps 1 through 5 are shared across all operations. Complete these steps first, then follow the operation-specific instructions.
Log on to the Realtime Compute for Apache Flink console.
Find the target workspace and click Console in the Actions column.
In the left-side navigation pane, choose Development > ETL.
Double-click the name of the target draft.
On the right side of the SQL editor, click the Versions tab.
Compare draft versions
You can compare two draft versions side by side. Only SQL code and deployment configurations are included in the comparison, and differences are highlighted.
Procedure
Complete the common steps.
In the Draft Versions panel, find the target version and click Diff in the Actions column.
In the Draft Version dialog box, use the Select Editing Version pane on the left side to select the version to compare against the version you are currently editing. The differences between the two versions are highlighted in the comparison view.
Roll back a draft version
You can roll back a deployed draft to a historical version.
Procedure
Complete the common steps.
In the Draft Versions panel, find the target version and choose More > Restore in the Actions column.
In the Draft Version dialog box, click Restore.
Lock a draft version
When the number of draft versions exceeds 50, the system automatically deletes the earliest version. To protect a version from automatic deletion, you can lock (pin) it.
Procedure
Complete the common steps.
In the Draft Versions panel, find the target version and choose More > Pin in the Actions column.
Result
After you pin a version, a lock icon appears next to the version number, and a confirmation message is displayed at the top of the page. The pinned version is excluded from automatic deletion.
To unlock a pinned version, find it in the Draft Versions panel and choose More > Unpin in the Actions column. You must unlock a version before you can delete it.
Delete a draft version
You can delete draft versions that you no longer need.
To delete a locked version, you must first unlock it by choosing More > Unpin in the Actions column. For more information, see Lock a draft version.
Procedure
Complete the common steps.
In the Draft Versions panel, find the target version and choose More > Delete in the Actions column.
In the Draft Version dialog box, click Delete.