An example of ClickHouse OLAP DBMS database using yandex/clickhouse-server image in IntelliJ-based IDEs.
Getting Started
- Run Docker services or Docker Desktop.
- Open
docker-compose.yaml
in IntelliJ-based IDEs and click on the gutter icon overservices
declaration. Alternatively, executesudo docker-compose up -d
in CLI. - Select View | Tool Windows | Database, select New and configure the following options:
- Host:
localhost
- Port:
8123
- User:
default
- Password: empty
- Database: empty or
default
- Host:
- Press Test Connection, save changes.
- Initialize a sample table by executing the code below in Query Console.
CREATE TABLE test_tbl
(
id UInt16,
create_time Date,
comment Nullable(String)
) ENGINE = MergeTree()
PARTITION BY create_time
ORDER BY (id, create_time)
PRIMARY KEY (id, create_time)
TTL create_time + INTERVAL 1 MONTH
SETTINGS index_granularity = 8192;
Insert into test_tbl
values (0, '2019-12-12', null);
Insert into test_tbl
values (0, '2019-12-12', null);
Insert into test_tbl
values (1, '2019-12-13', null);
Insert into test_tbl
values (1, '2019-12-13', null);
Insert into test_tbl
values (2, '2019-12-14', null);