跳到主要内容
跳到主要内容

将 ClickHouse 连接到 Deepnote

Community Maintained

Deepnote 是一个协作数据笔记本,旨在帮助团队发现和分享洞察。除了与 Jupyter 兼容之外,它还在云端工作,为您提供一个集中地点,以高效地协作和处理数据科学项目。

本指南假设您已经有一个 Deepnote 账户,并且您有一个正在运行的 ClickHouse 实例。

交互式示例

如果您想探索通过 Deepnote 数据笔记本查询 ClickHouse 的交互式示例,请点击下面的按钮以启动一个连接到 ClickHouse playground 的模板项目。

连接到 ClickHouse

  1. 在 Deepnote 中,选择“集成”概述并点击 ClickHouse 瓷砖。
  1. 提供您的 ClickHouse 实例的连接详细信息:

To connect to ClickHouse with HTTP(S) you need this information:

  • The HOST and PORT: typically, the port is 8443 when using TLS or 8123 when not using TLS.

  • The DATABASE NAME: out of the box, there is a database named default, use the name of the database that you want to connect to.

  • The USERNAME and PASSWORD: out of the box, the username is default. Use the username appropriate for your use case.

The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console. Select the service that you will connect to and click Connect:

Choose HTTPS, and the details are available in an example curl command.

If you are using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.


ClickHouseにHTTP(S)で接続するには、次の情報が必要です:

  • HOSTとPORT: 通常、ポートはTLSを使用する場合は8443、TLSを使用しない場合は8123です。

  • DATABASE NAME: デフォルトでは、defaultという名前のデータベースがあります。接続したいデータベースの名前を使用してください。

  • USERNAMEとPASSWORD: デフォルトでは、ユーザー名はdefaultです。ご利用のケースに適したユーザー名を使用してください。

ClickHouse Cloudサービスの詳細はClickHouse Cloudコンソールで確認できます。接続するサービスを選択し、Connectをクリックします:

HTTPSを選択すると、詳細が例のcurlコマンドで提供されます。

セルフマネージドのClickHouseを使用している場合、接続の詳細はClickHouseの管理者によって設定されます。

注意: 如果您的 ClickHouse 连接受 IP 访问列表保护,您可能需要允许 Deepnote 的 IP 地址。请在 Deepnote 的文档 中了解更多信息。

  1. 恭喜!您现在已经将 ClickHouse 集成到 Deepnote 中。

使用 ClickHouse 集成

  1. 首先,连接到您笔记本右侧的 ClickHouse 集成。

  2. 现在创建一个新的 ClickHouse 查询块并查询您的数据库。查询结果将作为 DataFrame 保存,并存储在 SQL 块中指定的变量中。

  3. 您还可以将任何现有的 SQL 块 转换为 ClickHouse 块。