The Cluster Explorer

Using the Cluster Explorer to select a cluster and run SQL queries

The Cluster Explorer lets you connect to a ClickHouse cluster and run queries against it. As an example, we’ll connect to the demo environment and work with the ClickHouse cluster github.

The first step is to connect to the demo environment. Click the name of your current environment at the top of the screen. A menu listing all of your environments will appear; select the demo environment. In Figure 1, demo is the current environment:

The Clusters tab in the Altinity Cloud Manager

Figure 1 – The Clusters tab in the Altinity Cloud Manager

Next, find the panel for the github ClickHouse cluster. Click the EXPLORE button at the bottom of the panel. You’ll be taken to this panel:

Cluster Launch Wizard summary

Figure 2 – The Cluster Explorer panel

Paste the following query into the text box:

SELECT toStartOfYear(merged_at) m, sum(merged) prs, uniq(creator_user_login) contributors
  FROM github_events
 WHERE merged_at>='2019-01-01'
   AND event_type = 'PullRequestEvent'
   AND repo_name in ('ClickHouse/ClickHouse', 'yandex/ClickHouse')
 GROUP BY m
 ORDER BY m

Click EXECUTE to run the query. The results show the number of merged PRs and unique contributors for each year since 2019. The three columns are titled m (year), prs and contributors:

┌──────────m─┬──prs─┬─contributors─┐
 2019-01-01  2278           232 
 2020-01-01  6000           300 
 2021-01-01  7766           366 
 2022-01-01  5639           392 
 2023-01-01   157            41 
└────────────┴──────┴──────────────┘