Create and delete a SQL draft
This document explains how to create and delete a SQL draft in Ververica Cloud.
Create a SQL draft
To enhance the efficiency of writing and managing Flink SQL jobs, Ververica Cloud provides a set of Flink SQL features. You can use these features to manage metadata, register user-defined functions (UDFs), and use the SQL editor.
-
On the Dashboard page, open the console for the workspace you want to manage.
-
In the Console navigation pane, click SQL editor and choose the Drafts tab.
-
Click New.
-
In the New Draft dialog box, select an SQL script template.
-
For a script without a code template, click Blank Stream Draft.
-
For scripts with a code template, click Flink Table, Temporary Table, Temporary View statement, INSERT INTO.
-
-
Click Next.
-
Configure the basic parameters of the draft:
Parameter Description Name The name of the draft that you want to create. Note: The draft name must be unique in the current project. Location The folder in which the code file of the draft is saved. Engine version The engine version of Flink that is used by the draft. -
Click Create.
-
Click Save.
-
Click Validate.
This checks the SQL semantics of the draft, network connectivity, and the metadata information of the tables that are used by the draft.
You can also click SQL Advice in the calculated results. This detects data risks and makes optimization suggestions for you. Data correctness analysis (such as nulls, changes etc) can be performed using this information.
-
Optional: Click Debug.
You can enable the debugging feature to simulate deployment running, check outputs, and verify the business logic of SELECT and INSERT statements. This feature improves development efficiency and reduces the risks of poor data quality. For more information, see Debug a deployment.
- Click Deploy.
After the draft development and syntax check are complete, you can deploy the draft to publish the data to the production environment. After the draft is deployed, you can start the deployment for the draft on the Deployments page to run the deployment. For more information, see Start a deployment.
Additional functionality
The SQL Editor has the following toolbar buttons and tabs:
Toolbar buttons
The following tools are available in the toolbar at the top of the SQL Editor window:
Title | Description | Icon |
---|---|---|
Save as | Save the Draft in the selected location/folder | |
Save | Save changes in the Draft | |
Create temporary table | Create a temporary table; Inserts a code snippet of the DDL statement into the current SQL editor | |
More | Access functions such as Undo, Redo, Find, Format | |
Validate | Checks the SQL semantics of the draft, network connectivity, and the metadata information of the tables that are used by the draft. You can also click SQL Advice in the calculated results to view information about SQL risks and related optimization suggestions. | |
Debug | Supports statement types including Query, Insert, and Auxiliary, such as Explain. Specify a running session cluster when starting | |
Deploy | Deploy your SQL draft, and the corresponding deployment appears at the top of the deployment list under the Deployments page | |
Operations | Redirect to the corresponding deployment page (Deployment details, Overview, Metrics, Events, Exploration). Button disabled if the SQL draft hasn’t been deployed yet |
Tabs
The tabs on the edges of the SQL Editor page are as follows:
Title | Description | Additional info |
---|---|---|
Drafts | This lists all the SQL drafts you have created. Double-click on an item to load it into the SQL editor window. | |
Catalogs | This lists any custom catalogs you have defined. | See Manage table catalogs |
UDFs | List the SQL draft’s deployed history, and revert to a particular version | See Manage user-defined functions |
Configurations | Configure Engine Version and Additional Dependencies of the SQL Draft | See Manage deployment default settings |
Structure | Display a data-flow diagram for the FlinkSQL in either DAG or tree mode | See View the SQL draft code structure |
Versions | List the SQL draft’s deployed history, and revert to a particular version | See Manage published job versions |
Delete a SQL draft
To delete a SQL draft:
-
On the Dashboard page, open the console for the workspace you want to manage.
-
In the Console navigation pane, click SQL editor and choose the Drafts tab.
-
Select the SQL Draft you want to delete and click the Delete the selected draft (trashcan) icon.