Data Analysis is the compute engine of EventHouse. It provides high-performance SQL queries, stream processing, and federated queries for real-time aggregation, analysis, and visualization of event data in EventStore.
Scenarios
-
Real-time Anomaly Detection: Time window functions calculate real-time metrics such as transaction success rate and latency distribution. If an analysis result triggers a threshold, such as more than 100 failed orders within 1 minute, the rules engine automatically triggers an alert.
-
Cross-Source Association Analysis: Federated queries join real-time event data in EventHouse with user dimension tables in RDS and log files in OSS without migrating the data to a single storage location.
-
Event Full-Text Index: The SEARCH syntax performs a full-text search on event content to quickly locate event records that contain specific keywords.
Prerequisites
-
The EventBridge service is enabled.
-
You have created a catalog, a namespace, and an event table in the data catalog. For more information, see Data Catalog.
Access the Data Analysis Page
-
Log on to the EventBridge console.
-
In the navigation pane, choose EventStore > Data Analysis.
The page has three areas:
|
Area |
Location |
Description |
|
Catalog Panel |
Left |
Displays the data catalog tree, with levels: Catalog > Namespace > Event Table > Columns. Supports search, refresh, and collapse. |
|
SQL Editor |
Top right |
The SQL query editor, including the query range selector, time range selector, and Run button. |
|
Output Panel |
Bottom right |
Displays query results in Table or Visualization mode. |
Execute SQL Queries
-
In the Query Range Selector area above the SQL editor, select the target catalog and namespace.
Run button is enabled only after you select a query range.
-
In the Time Range Selector, select a query time range.
The following preset and custom time ranges are available:
Category
Available Range
Minutes
Last 5 minutes, Last 10 minutes, Last 15 minutes
Hours
Last 1 hour, Last 6 hours, Last 24 hours
Day
Half day, Today, Last 3 days
Week
This week, Last 2 weeks, Last 3 weeks
Month
This month, Last 2 months, Last 3 months
Custom
Specify start and end times using the date picker.
The default time range is Last 3 days.
-
Enter a query statement in the SQL editor.
The SQL editor is based on Monaco Editor and supports syntax highlighting and line number display. For more information about the query syntax, see Query syntax.
-
Click the Run button to execute the query.
The Run button supports two execution modes:
Mode
Description
Full Query
Returns all matching query results.
LIMIT 1000
Automatically adds
LIMIT 1000to the end of the query statement, returning only the first 1000 results.Click the drop-down arrow to the right of the Run button to switch between execution modes.
View Query Results
After the query is executed, results appear in the Output Panel. The Output Panel has two tabs: Table and Visualization.
Table Tab
The Table tab displays query results and supports the following features:
|
Feature |
Description |
|
Number of Events |
Displays the total number of query results. Supports collapse. |
|
Display Mode |
Supports two modes: Table (default) and Raw. |
|
Filter Columns |
Show or hide specific columns. |
|
Paging |
Set the number of items per page (10 by default) and navigate through results by using page numbers. |
Visualization Tab
The Visualization tab displays query results as charts.
-
Click the Visualization tab, and then click Add Chart.
-
In the Edit Chart dialog box, select a chart type and configure the chart parameters.
The following chart types are supported:
Chart Type
Description
Line Chart
Suitable for displaying change trends of data over time. Default chart type.
Column Chart
Suitable for comparing data volume across different categories.
Pie Chart
Suitable for displaying the proportion of each part to the whole.
The chart editor provides the following configuration items. A line chart is used as an example:
Configuration Category
Configuration Item
Panel Configuration
Panel title, panel description, display background border.
Graphic Configuration
Line style (line width, line style, connection method), fill style, point style, data labels, stacking, gridline.
Legend Configuration
Display legend, legend mode (list/table), legend position (bottom/top), legend sorting.
Tooltip Configuration
Sorting, display title, decimal place.
X-Axis Configuration
Display X-axis, X-axis title, number of ticks, format.
Y-Axis Configuration
Display Y-axis, unit, number of ticks, Y-axis range.
-
After you complete the configuration, click OK to save the chart.
To add multiple Visualization tabs, click the + button in the Output Panel.
Multi-Tab Analysis
Data Analysis supports multiple analysis tabs at the same time. Each tab independently maintains its own query range, time range, SQL content, and query results.
-
Click the + button in the SQL editor area to create a new analysis tab.
-
Click the Close button on a tab to close it.
Catalog Panel Operations
The Catalog panel displays the data catalog hierarchy: Catalog > Namespace > Event Table > Columns.
|
Operation |
Description |
|
Search |
Enter keywords in the search box to filter the directory tree. |
|
Refresh |
Click the Refresh button to update the directory tree. |
|
Expand Table |
Expand the Event Table node to view all column names and data types. |
|
View Table Information |
Hover over a table name to view its description; supports copying the table name. |
|
Show/Hide |
Toggle the Catalog Panel by using the toolbar button. |
Query Syntax
Data Analysis supports SQL queries compatible with PostgreSQL syntax and provides extended full-text search capabilities. For more information, see the PostgreSQL Official Manual.
SQL Query
Data Analysis supports standard PostgreSQL syntax, including clauses such as SELECT, WHERE, GROUP BY, ORDER BY, JOIN, and LIMIT.
Example: Query the event data in a specified table.
SELECT order_id, amount, status
FROM "order-events"
LIMIT 10
-
Table names must be enclosed in double quotation marks.
-
A SELECT * statement is automatically converted to a SELECT statement that specifies column names. To improve query efficiency, specify only the required columns in your query.
-
All queries are automatically limited to the selected catalog and namespace.
-
All queries require a specified time range (__time__). You can set this time range using the time range selector in the console and do not need to manually specify it in the SQL statement.
-
When you join external tables in a federated query, you do not need to specify __time__ for the external tables.
Full-Text Index
The SEARCH keyword performs a full-text search on event content.
Syntax:
SELECT * FROM "table_name" SEARCH 'keyword'
Example: Retrieve event records that contain "error":
SELECT * FROM "order-events" SEARCH 'error'
Note: The search content after the SEARCH keyword must be enclosed in single quotation marks.
Query Syntax Summary
|
Query Type |
Syntax Description |
Example |
|
Full-text index |
Use the |
|
|
Standard SQL |
Compatible with PostgreSQL SQL syntax. |
|
|
Federated Query |
Associate internal tables with external data sources using |
|