The EMR Serverless StarRocks SQL editor is an interactive query editor. You can write, run, and manage SQL statements directly in the console without needing to download or install a local client. This simplifies real-time data query and analysis for data analysts and developers.
Prerequisites
You have created a StarRocks instance. For more information, see Create an instance.
Notes
The SQL editor uses the semicolon (;) as the statement separator by default. If your SQL statement contains a semicolon (;), it might cause a syntax parsing error.
To prevent this issue:
Set a custom delimiter.
Before running an SQL statement that contains a semicolon, declare a custom delimiter to prevent parsing errors. For example:
delimiter $$Restore the default delimiter.
After you execute the SQL statement, restore the default delimiter (
;) so that subsequent SQL operations can run correctly.delimiter ;
Open the SQL editor
-
Go to the E-MapReduce Serverless StarRocks instance list page.
-
Log on to the E-MapReduce console.
-
In the navigation pane on the left, choose .
-
In the top menu bar, select the required region.
-
On the Instances page, find the desired instance and click Connect in the Connect column. For more information, see Connect to a StarRocks instance by using StarRocks Manager.
You will be prompted to select a user identity to connect to the instance.
SQL editor UI
The SQL editor UI has four main sections: the files panel on the left, a toolbar at the top, the editor in the center, and the results panel at the bottom. The toolbar includes selectors for default_catalog, a database, and a compute group.
Item | Description |
① | The files panel on the left displays available files, including ready-to-use TPC-DS and TPC-H benchmark scripts that you can run directly in the editor. For more information, see TPC-DS and TPC-H. |
② | Click the |
③ | Click Run to execute all SQL statements in the editor from start to finish. To run only a portion of the script, select the desired code and click the Note This icon appears only when you select one or more lines of code. |
④ | Click Save to save all statements. |
⑤ | Click Format to automatically adjust indentation, line breaks, and keyword case. |
⑥ | The results panel at the bottom displays query results or error messages. |
⑦ | Click the |
⑧ | Click the |
⑨ | In the lower-right corner of the page, click Query Analysis to diagnose the query execution plan. For more information, see Query management and analysis. |
Related documentation
To view and analyze all database operations, enable the audit log. For more information, see Audit logs.
icon to create a new SQL query. When you first open the SQL editor, you can also click the
icon.
icon that appears on the left.
icon to export the query results.
icon to display the query results or error messages in full-screen mode.