Skip to main content

SQL deployment

Overview

Ververica Cloud allows you to edit drafts and run deployments using SQL code. This topic explains how to perform various operations, such as accessing Ververica Cloud, creating SQL drafts, and running SQL deployments.

Prerequisites

You must have created an existing account and workspace (for example by following the steps in in Get started).

Procedure

The procedure consists of three steps:

  • Step 1: Create an SQL draft and write business code on the SQL Editor page.
  • Step 2: Start the deployment
  • Step 3: View the results of the deployment

Step 1: Create an SQL draft

To create your first SQL draft:

  1. On your Dashboard page, do one of the following:

    • Click the name of the workspace that you created in Set up your free trial account.
    • Click the triple dots at the end of the workspace entry and select Open Console. The Ververica Cloud console for the workspace will be displayed.
  2. In the module navigation panel, click SQL Editor.

    image

  3. In the SQL module working area, click New.

    image

  4. In the New Draft dialog box, select the blank template and click Next.

    image

  5. Enter a Name (e.g. My_first_SQL) and click Create.

    image

    note

    For this tutorial you can accept the default values for the Location and Engine Version (you might need to scroll down to see this option).

  6. Copy the deployment code below and paste it into the code editor panel on the right.

    CREATE TEMPORARY TABLE datagen_source( 
    randstr VARCHAR
    ) WITH (
    'connector' = 'datagen'
    );

    CREATE TEMPORARY TABLE print_table(
    randstr VARCHAR
    ) WITH (
    'connector' = 'print',
    'logger' = 'true'
    );

    INSERT INTO print_table
    SELECT SUBSTRING(randstr,0,8) from datagen_source;
    note

    This creates a datagen source table that generates random data, and enables the system to display the data of the randstr field in the datagen source table.

    image

  7. Click Validate to check the syntax.

    image

  8. Click Deploy.

    image

  9. In the Deploy draft dialog box, click Confirm.

    image

  10. The draft name will be displayed with a green success icon, and you’ll see a notification in the top right of the Console toolbar. Click the notification icon to view the message.

    image

Step 2: Start the deployment

To start the SQL deployment:

  1. In the Module navigation pane, click Deployments.

  2. Find the new Deployment and click Start in the Actions column.

    image

  3. In the Start Job dialog box, select Initial mode and click Start.

    image

    Initially, the status will be STARTING.

    image

  4. After the deployment is started, the deployment status changes to RUNNING. This indicates that the deployment is running properly.

Step 3: View the results

To view the results:

  1. On the Deployments page, click the name of the Deployment.

  2. Click the Diagnostics > Logs tab.

    image

  3. On the Logs tab, click Running Task Managers and click the value in the Path, ID column.

    image

  4. On the Logs tab, search for logs related to the sink.

    tip

    You can press Ctrl+F (or your OS equivalent) in the log output window to search for text in the log file.

    image