Skip to main content

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.

  1. On the Dashboard page, open the console for the workspace you want to manage.

  2. In the Console navigation pane, click SQL editor and choose the Drafts tab.

  3. Click New.

  4. 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.

  5. Click Next.

  6. Configure the basic parameters of the draft:

    ParameterDescription
    NameThe name of the draft that you want to create. Note: The draft name must be unique in the current project.
    LocationThe folder in which the code file of the draft is saved.
    Engine versionThe engine version of Flink that is used by the draft.
  7. Click Create.

  8. Click Save.

  9. 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.

  10. 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.

  1. 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:

TitleDescriptionIcon
Save asSave the Draft in the selected location/folderSave As button
SaveSave changes in the DraftSave button
Create temporary tableCreate a temporary table; Inserts a code snippet of the DDL statement into the current SQL editorCraete temporary table button
MoreAccess functions such as Undo, Redo, Find, FormatMore button
ValidateChecks 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.Validate button
DebugSupports statement types including Query, Insert, and Auxiliary, such as Explain. Specify a running session cluster when startingDebug button
DeployDeploy your SQL draft, and the corresponding deployment appears at the top of the deployment list under the Deployments pageDeploy button
OperationsRedirect to the corresponding deployment page (Deployment details, Overview, Metrics, Events, Exploration). Button disabled if the SQL draft hasn’t been deployed yetOperations button

Tabs

The tabs on the edges of the SQL Editor page are as follows:

TitleDescriptionAdditional info
DraftsThis lists all the SQL drafts you have created. Double-click on an item to load it into the SQL editor window.
CatalogsThis lists any custom catalogs you have defined.See Manage table catalogs
UDFsList the SQL draft’s deployed history, and revert to a particular versionSee Manage user-defined functions
ConfigurationsConfigure Engine Version and Additional Dependencies of the SQL DraftSee Manage deployment default settings
StructureDisplay a data-flow diagram for the FlinkSQL in either DAG or tree modeSee View the SQL draft code structure
VersionsList the SQL draft’s deployed history, and revert to a particular versionSee Manage published job versions

Delete a SQL draft

To delete a SQL draft:

  1. On the Dashboard page, open the console for the workspace you want to manage.

  2. In the Console navigation pane, click SQL editor and choose the Drafts tab.

  3. Select the SQL Draft you want to delete and click the Delete the selected draft (trashcan) icon.

Delete SQL draft