Skip to main content

Getting started with a Flink 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, click the workspace name that you want to open.

    The workspace Console will be displayed.

  2. Display the SQL Editor page, then click New.

  3. In the New Draft dialog box, select the Blank Stream Draft template and click Next.

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

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

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

  6. Click Validate to check the syntax. It should pass with no issues, and a confirmation will be displayed under the SQL code panel.

  7. Click Deploy.

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

  9. 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 COnsole, click Deployments.

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

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

    Initially, the status will be STARTING.

  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 > Stdout tab.

  3. On the Logs tab, click Running Task Managers.

  4. Click the value in the Path, ID column.

    image

  5. Display the Stdout tab to see the results.

    image

More information

For more details, see: