All Products
Search
Document Center

E-MapReduce:Connect to a StarRocks instance using EMR StarRocks Manager

Last Updated:Mar 26, 2026

SQL editor is the browser-based query interface in EMR StarRocks Manager. Use it to write, run, and manage SQL queries against your EMR Serverless StarRocks instance — no client software required.

Prerequisites

Before you begin, ensure that you have:

  • An EMR Serverless StarRocks instance

  • The instance credentials (username and password set at instance creation)

Connect to the SQL editor

  1. Log on to the EMR console.

  2. In the left-side navigation pane, choose EMR Serverless > StarRocks.

  3. In the top navigation bar, select the region where your instance resides.

  4. On the Instances tab, find your instance and click Connect in the Actions column.

  5. Connect to the instance. If this is your first time connecting to this instance, create a new connection. If you have connected before, use an existing connection.

    Create a new connection

    1. On the New Connection tab, configure the following parameters.

      image.png

      Parameter Description Example
      Region The region where the EMR Serverless StarRocks instance resides. China (Hangzhou)
      Instance The name of the EMR Serverless StarRocks instance. StarRocks_Serverlesss
      Connection Name A custom name for this connection. Must be 1–64 characters and can contain letters, digits, hyphens (-), and underscores (_). Connection_Serverlesss
      Username The username for logging on to the instance. The default initial username is admin. You can also create another user based on your business requirements. admin
      Password The password set when you created the instance.
    2. Click Test Network Connectivity.

    3. After the connectivity test passes, click OK.

    Use an existing connection

    Important

    If the EMR Serverless StarRocks instance associated with a saved connection has been deleted, create a new connection instead.

    On the Existing Connections tab, find the connection and click Connect in the Actions column.

    image

Run SQL queries

The following steps walk through creating a database and table, inserting data, and querying it using the SQL editor.

  1. In the left-side navigation pane, click SQL Editor. On the Queries tab, click File or the image icon to create a file. In the Create File dialog box, configure the parameters and click Confirm.

  2. In the code editor, paste the following SQL statements and click Run:

/* Create a database. */
create database test_sql_editor_db;

/* Use the database. */
use test_sql_editor_db;

/* Create a table. */
CREATE TABLE
    `emr_query_logs` (
        `conn_id` varchar(10) NULL COMMENT "",
        `database` varchar(100) NULL COMMENT "",
        `start_time` bigint (20) NULL COMMENT "",
        `end_time` bigint (20) NULL COMMENT "",
        `event_time` bigint (20) NULL COMMENT "",
        `is_query` boolean NULL COMMENT "",
        `latency` int (11) NULL COMMENT "",
        `query_id` varchar(40) NULL COMMENT "",
        `remote_ip` varchar(15) NULL COMMENT "",
        `state` varchar(20) NULL COMMENT "",
        `user` varchar(20) NULL COMMENT ""
    ) ENGINE = OLAP DUPLICATE KEY (`conn_id`) COMMENT "OLAP" DISTRIBUTED BY HASH (`user`) BUCKETS 10 PROPERTIES (
        "replication_num" = "2",
        "in_memory" = "false",
        "storage_format" = "DEFAULT",
        "enable_persistent_index" = "false",
        "compression" = "LZ4"
    );

/* Insert data into the table. */
insert into
    test_sql_editor_db.emr_query_logs (
        `conn_id`,
        `database`,
        `start_time`,
        `end_time`,
        `event_time`,
        `is_query`,
        `latency`,
        `query_id`,
        `remote_ip`,
        `state`,
        `user`
    )
values
    (
        '54656',
        'tpc_h_sf1',
        1691635106990,
        1691635107405,
        1691635107405000000,
        1,
        415,
        'fbec0dd7-3726-11ee-a3ef-720338511ec3',
        '10.0.**.**',
        'FINISHED',
        'admin'
    ),
    (
        '54658',
        'tpc_h_sf1',
        1691635107632,
        1691635107860,
        1691635107860000000,
        1,
        228,
        'fc4e0301-3726-11ee-a3ef-720338511ec3',
        '10.0.**.**',
        'FINISHED',
        'admin'
    ),
    (
        '54659',
        'tpc_h_sf1',
        1691635108757,
        1691635108930,
        1691635108930000000,
        1,
        173,
        'fcf9ac5s8-3726-11ee-a3ef-720338511ec3',
        '10.0.**.**',
        'FINISHED',
        'admin'
    ),
    (
        '54661',
        'tpc_h_sf1',
        1691635108994,
        1691635109137,
        1691635109137000000,
        1,
        143,
        'fd1dd62e-3726-11ee-a3ef-720338511ec3',
        '10.0.**.**',
        'FINISHED',
        'admin'
    ),
    (
        '54663',
        'tpc_h_sf1',
        1691635109445,
        1691635109533,
        1691635109533000000,
        1,
        88,
        'fd62a765-3726-11ee-a3ef-720338511ec3',
        '10.0.**.**',
        'FINISHED',
        'admin'
    ),
    (
        '54664',
        'tpc_h_sf1',
        1691635109724,
        1691635109907,
        1691635109907000000,
        1,
        183,
        'fd8d39d9-3726-11ee-a3ef-720338511ec3',
        '10.0.**.**',
        'FINISHED',
        'admin'
    );

/* View table information. */
select * from test_sql_editor_db.emr_query_logs;
  1. The query results are displayed on the Output result tab. The following figure shows an example.

    image.png

What's next

For the full capabilities of EMR StarRocks Manager — including data management, diagnostics and analytics, and security permission configuration — see SQL editor.