QuickSight
QuickSight can connect to on-premise ClickHouse setup (23.11+) via MySQL interface using the official MySQL data source and Direct Query mode.
On-premise ClickHouse Server Setup
Please refer to the official documentation on how to set up a ClickHouse server with enabled MySQL interface.
Aside from adding an entry to the server's config.xml
it is also required to use Double SHA1 password encryption for the user that will be using MySQL interface.
Generating a random password encrypted with Double SHA1 from the shell:
The output should look like the following:
The first line is the generated password, and the second line is the hash we could use to configure ClickHouse.
Here is an example configuration for mysql_user
that uses the generated hash:
/etc/clickhouse-server/users.d/mysql_user.xml
Replace password_double_sha1_hex
entry with your own generated Double SHA1 hash.
QuickSight requires several additional settings in the MySQL user's profile.
/etc/clickhouse-server/users.d/mysql_user.xml
However, it is recommended to assign it to a different profile that can be used by your MySQL user instead of the default one.
Finally, configure the Clickhouse Server to listen on the desired IP address(es).
In config.xml
, uncomment out the following to listen on all addresses:
If you have the mysql
binary available, you can test the connection from the command line.
Using the sample username (mysql_user
) and password (LZOQYnqQN4L/T6L0
) from above the command line would be:
Connecting QuickSight to ClickHouse
First of all, go to https://quicksight.aws.amazon.com, navigate to Datasets and click "New dataset":
![Creating a new dataset](/docs/assets/images/quicksight_01-7f8cb0134a959102506a85095155f01a.png)
Search for the official MySQL connector bundled with QuickSight (named just MySQL):
![MySQL connector search](/docs/assets/images/quicksight_02-4b37b3ebb245c79bbbd5f2c678fdc562.png)
Specify your connection details. Please note that MySQL interface port is 9004 by default, and it might be different depending on your server configuration.
![Specifying the connection details](/docs/assets/images/quicksight_03-3735be9ab91d14441b231c34423dc489.png)
Now, you have two options on how to fetch the data from ClickHouse. First, you could select a table from the list:
![Selecting a table from the list](/docs/assets/images/quicksight_04-d17efd6f423d7437c94e99a2ad7dee95.png)
Alternatively, you could specify a custom SQL to fetch your data:
![Using custom SQL to fetch the data](/docs/assets/images/quicksight_05-64e64ffe70d713150127f72701aa2a6c.png)
By clicking "Edit/Preview data", you should be able to see the introspected table structure or adjust your custom SQL, if that's how you decided to access the data:
![Viewing the introspected table structure](/docs/assets/images/quicksight_06-8f5862289f51bb9fc5a4a9243909db9d.png)
Make sure you have "Direct Query" mode selected in the bottom left corner of the UI:
![Choosing the Direct Query mode](/docs/assets/images/quicksight_07-8f156510fd760acf20d5ccaae19b90b1.png)
Now you can proceed with publishing your dataset and creating a new visualization!
Known limitations
- SPICE import doesn't work as expected; please use Direct Query mode instead. See #58553.