All Products
Search
Document Center

Hologres:Development with Hologres SQL

Last Updated:Mar 26, 2026

Hologres SQL is an SQL editor in DataStudio that lets you run SQL statements against your Hologres instance — create tables, insert data, and query results without leaving the DataWorks environment.

Prerequisites

Before you begin, ensure that you have:

Create a business flow

A business flow groups related nodes in DataStudio. Create one before adding a Hologres SQL node.

  1. Log on to the DataWorks console. Select the region where your Hologres instance resides. In the left navigation pane, click Workspaces.

  2. On the Workspace List page, find the target workspace. In the Actions column, click Quick Access > Data Development to open the DataStudio page.

  3. In the left navigation pane, click the 数据开发 icon to open the Data Development page.

  4. In the top menu bar, hover over Create and click Create Business Flow.

  5. In the Create Business Flow dialog box, fill in the following parameters.

    ParameterDescription
    Business NameCustomize the service name.
    DescriptionA description of the business flow

    新建业务流程

  6. Click Create.

Create a Hologres SQL node

A Hologres data source must be attached to the DataWorks workspace before you can create a Hologres SQL node. See Attach a Hologres instance.
  1. On the Data Development page, hover over Create in the top menu bar and choose Create Node > Hologres > Hologres SQL.

  2. In the Create Node dialog box, configure the following:

    ParameterDescription
    Engine InstanceThe Hologres instance that executes your SQL statements. Select the correct instance — choosing the wrong one means your changes appear in an unintended instance.
    NameA name for the node.
    PathThe location within the business flow.
  3. Click OK.

Run your first queries

Open the Hologres SQL node you created. Paste the following statements into the editor and click the Run 运行 icon.

The script creates a table named supplier_holo, optimizes it for common query patterns, inserts sample rows, and then queries the data — a complete development cycle in a single script.

BEGIN;

CREATE TABLE supplier_holo (
  s_suppkey  bigint NOT NULL,
  s_name     text   NOT NULL,
  s_address  text   NOT NULL,
  s_nationkey bigint NOT NULL,
  s_phone    text   NOT NULL,
  s_acctbal  bigint NOT NULL,
  s_comment  text   NOT NULL,
  PRIMARY KEY (s_suppkey)
);

-- Enable bitmap indexes on filter columns
-- to speed up range and equality queries.
CALL SET_TABLE_PROPERTY('supplier_holo', 'bitmap_columns', 's_suppkey,s_nationkey,s_acctbal,s_name');

-- Enable dictionary encoding on low-cardinality text columns
-- to reduce storage and improve compression.
CALL SET_TABLE_PROPERTY('supplier_holo', 'dictionary_encoding_columns', 's_name,s_address');

-- Set a time-to-live (TTL) of one year (31,536,000 seconds).
-- Hologres automatically removes rows older than this threshold.
CALL SET_TABLE_PROPERTY('supplier_holo', 'time_to_live_in_seconds', '31536000');

COMMIT;

INSERT INTO supplier_holo VALUES
  (1,  'Supplier01', 'New York',  17, '27-918-335-1736',        575594, 'careful'),
  (6,  'Supplier06', 'London',    14, '24-696-997-4969',        136579, 'final accounts '),
  (10, 'Supplier03', 'Beijing',   24, '34-852-489-8585',        389191, 'ing waters'),
  (18, 'Supplier04', 'Paris',     16, '26-729-551-1115',        704082, 'accounts snooze'),
  (39, 'Supplier05', 'Shanghai',   8, '18-851-856-5633 611565',  88990, 'special packages'),
  (48, 'Supplier06', 'Canada',    14, '24-722-551-9498',        563062, 'xpress instructions affix');

SELECT * FROM supplier_holo;

FAQ

Engine information doesn't appear in the SQL editor

The engine instance section is hidden. In the upper-left corner of the Data Development page, click the 显示方式 icon and deselect Hide Engine Instance.

显示方式

What Hologres instance does "Hologres Engine Instance" in the SQL editor correspond to?

Hologres引擎实例

Hologres Engine Instance is the display name of the attached Hologres instance. To find the corresponding instance details, click the 工作空间管理 icon in the upper-right corner to open the Workspace Management page, then look up the instance in the Hologres attachment list.

Hologres table names don't appear when I choose "Associate Table from Engine"

Right-click a Hologres > Table node and choose Associate Table from Engine. If no tables appear, the Hologres metadata hasn't been collected yet. Collect it in Data Map first, then retry the association. For details, see Data Map.