Debug a SQL draft
This document explains how to enable deployment debugging to simulate deployment running, check outputs, and verify the business logic of SELECT, INSERT and auxiliary statements. This feature improves development efficiency and reduces the risks of poor data quality. This topic describes how to debug a Flink SQL deployment.
After the process description, there is a worked example at the end of this topic.
Background Information
The deployment debugging feature allows you to verify the correctness of the draft’s FlinkSQL logic in the console of fully managed Flink. During the debugging, data is not written to the result table regardless of the type of the result table. When you use the deployment debugging feature, you can use the upstream online data or local mock data. You can debug complex deployments that include multiple SELECT or INSERT statements, and auxiliary statements such as EXPLAIN. SQL query statements allow you to use UPSERT statements that contain update operations, such as count (*).
Prerequisites
A running session cluster which matches the engine version of the debugged SQL draft.
Limits
- To use the deployment debugging feature, you must first create a session cluster.
- You can debug certain types of FlinkSQL statements. DDL statements are not supported.
- You can only debug SQL deployments.
- You cannot debug deployments in which the CREATE TABLE AS or CREATE DATABASE AS statement is executed.
- MySQL CDC source tables are not written in append-only mode. Therefore, you cannot debug data of MySQL CDC source tables for session clusters of VERA 1.0.3 or an earlier version.
- By default, fully managed Flink reads a maximum of 1,000 data records. If the number of data records that are read by fully managed Flink reaches the upper limit, fully managed Flink stops reading data.
Limits on Debugging Data Files
- Only a CSV file is supported.
- A CSV file must contain a table header, such as id (INT).
- A CSV file can contain a maximum of 1,000 data records but cannot be greater than 1 MB.
Precautions
See the precautions relating to Session Clusters.
Procedure
Step 1: Create a Session Cluster
These steps are described in Create a session cluster.