tencent cloud

Stream Compute Service

Data Exploration

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-08-18 16:58:52
AI翻訳
Data Exploration is a lightweight SQL query workbench provided by SCS. It allows you to directly write and run SQL statements in the console to query and validate data, without the need to create and publish a full job.
Data Exploration is applicable to the following scenarios:
SQL Syntax Validation: Quickly validate the correctness of SQL statements and check whether function calls and expressions meet expectations.
Metadata Query: View metadata information such as Catalogs, databases, tables, views, and functions within the workspace.
Data Exploration and Debugging: Explore and preview data in source tables, dimension tables, and result tables to verify whether the data format and content meet expectations.
Querying External Catalogs such as MySQL / Paimon / Hive: Directly query data from registered external Catalogs.
Improved SQL Development Efficiency: During job development, use Data Exploration to quickly validate SQL snippets, reducing the debugging cycle from writing to publishing.

Operation Steps

Step 1: Go to Data Exploration

1. Log in to the SCS console and go to the target workspace.
2. In the left sidebar, select Data Exploration to go to the Data Exploration page.
3. Click New Exploration File, and then create it after entering a file name.
4. After creation, write the query statement in the SQL editor.

Step 2: Select a Session Cluster

In the right area of the Data Exploration page:
1. In the Session Cluster drop-down list, select a running Session cluster (Flink version must be 1.16 or later).
Supported Flink versions: 1.16, 1.18, and 1.20.
If no available Session cluster exists in the list, create a Session cluster first.
2. If an external Catalog is registered in the workspace, the system automatically loads it and makes it available for queries.

Step 3: Write SQL

Data Exploration supports the full syntax of Flink SQL, including:
SQL Type
Description
Example
SHOW Statement
Query metadata information
SHOW CATALOGS;,SHOW DATABASES;,SHOW TABLES;
DESCRIBE Statement
View the table structure.
DESCRIBE table_name;
SELECT queries
Data queries
SELECT * FROM source_table;
CREATE Statement
Create temporary tables/views
CREATE TEMPORARY TABLE ... WITH (...);
INSERT
Data writes (by submitting a Flink job)
INSERT INTO sink_table SELECT ... FROM source_table;
SET Statement
Set execution parameters
SET 'execution.runtime-mode' = 'streaming';
EXPLAIN Statement
View the execution plan
EXPLAIN SELECT ...;
USE Statement
Switch the Catalog/Database
USE CATALOG my_catalog;

Step 4: Execute the Query

1. Select the SQL statement to be executed, and then click the Execute button to run the query.
2. Click the Run button to execute the query.
For query statements such as SELECT / SHOW / DESCRIBE, the results are displayed directly in the Run Results area at the bottom of the page.
For an INSERT statement, a Flink job is submitted to the Session cluster for execution.
3. Query results display a maximum of 5000 rows and can be exported for download in CSV format.

Query Example

Basic Search

-- View the current Catalog and Database
SHOW CURRENT CATALOG;
SHOW CURRENT DATABASE;

-- View all Catalogs
SHOW CATALOGS;

-- Simple Query
SELECT 1;
SELECT CURRENT_TIMESTAMP AS ts, UUID() AS u;
SELECT CAST('2026-01-01' AS DATE) AS d;

-- Multi-Column Query
SELECT 1 AS id, 'hello' AS name, 3.14 AS pi;

Table Operation

-- Create a temporary table (Data Generator)
CREATE TEMPORARY TABLE datagen_source (
id INT,
name STRING
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1',
'number-of-rows' = '10'
);

-- Query the temporary table
SELECT * FROM datagen_source;

-- Aggregate Query
SELECT COUNT(*) AS cnt, AVG(id) AS avg_id FROM datagen_source;

External Catalog Query

-- Switch to the Paimon Catalog
USE CATALOG my_paimon_catalog;

-- View databases and tables
SHOW DATABASES;
USE my_database;
SHOW TABLES;

-- Query the Paimon table
SELECT * FROM my_table LIMIT 100;
SELECT COUNT(*) FROM my_table;

VALUES Query

-- Query with VALUES clause (Data Construction)
SELECT * FROM (VALUES (1, 'a'), (2, 'b'), (3, 'c')) AS t(id, name);

-- Filter with WHERE clause
SELECT x, x*x AS sq FROM (VALUES (1),(2),(3),(4),(5)) AS t(x) WHERE x > 2;

-- Aggregate with GROUP BY
SELECT grp, COUNT(*) AS cnt, SUM(val) AS total
FROM (VALUES ('a',1), ('a',2), ('b',10), ('b',20)) AS t(grp, val)
GROUP BY grp;

SET Statement (Modifying Execution Parameters)

-- View the current configuration
SET;

-- View the specified configuration
SET 'parallelism.default';

-- Switch the execution mode
SET 'execution.runtime-mode' = 'streaming';
SET 'execution.runtime-mode' = 'batch';

-- Set the time zone
SET 'table.local-time-zone' = 'Asia/Shanghai';

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック