Configure the required permissions for ClarityQ to discover schemas, query data, and cancel its own queries:
-- Grant read access to the databases ClarityQ should accessGRANT SELECT ON analytics.* TO clarityq_user;GRANT SELECT ON events.* TO clarityq_user;-- Or grant access to specific tables onlyGRANT SELECT ON analytics.orders TO clarityq_user;-- Grant query cancellation, so stopping a question stops the work on your serverGRANT SELECT(query_id, user, query) ON system.processes TO clarityq_user;
ClickHouse filters its metadata views by these grants, so the account’s SELECT privileges determine which tables ClarityQ discovers.
Ensure your ClickHouse server allows connections from the following ClarityQ IP addresses:
44.218.213.75
54.161.37.107
54.208.212.67
On ClickHouse Cloud, select your service, go to Settings → Security and add these addresses to the IP access list. A new service starts with no addresses allowed, so ClarityQ reaches it once they are added.On a self-hosted server, allow inbound connections on the HTTP port (8443 or 8123) in your firewall or security group.
Add the ClarityQ IP addresses to the Cloud IP access list, firewall or security group (see Step 3)
Enter the hostname on its own, with the scheme and port left out of the field
Connection refused or TLS handshake error
Match the Port to the transport: 8443 with Connect over TLS enabled, 8123 with it disabled
Behind a proxy, use the port your ClickHouse URL uses
Database not found
Check the spelling of the Database field against the databases listed in the error message
Clear the field to catalogue every database the user can read
Database is not visible to the user
Grant the user access to it: GRANT SELECT ON your_database.* TO clarityq_user
User has no grants on any database
Grant SELECT on the databases ClarityQ should read (see Step 2)
Cannot read system.databases
Allow the user to read ClickHouse’s metadata views, which ClarityQ uses to discover schemas
Authentication failed
Re-enter the credential your server uses, either Password or Access Token — one credential is stored per connection
For access tokens, issue a fresh JWT if the previous one has expired
Tables missing after discovery
Clear the Database field to catalogue every database instead of the one you named
Grant the user SELECT on the missing databases
Query system and information_schema tables by name; they stay out of the catalog
Stopping a question leaves the query running
Grant SELECT(query_id, user, query) ON system.processes so ClarityQ can cancel with KILL QUERY (see Step 2)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ClarityQ Documentation","colors":{"primary":"#5A57FC","light":"#9391ff","dark":"#5A57FC"},"logo":{"light":"https://mintcdn.com/clarityq/RMDLvxRyN9-VIA7h/logo/light.svg?fit=max\u0026auto=format\u0026n=RMDLvxRyN9-VIA7h\u0026q=85\u0026s=f8d4e57d3c0e50c3f720e5b6a7afef0b","dark":"https://mintcdn.com/clarityq/RMDLvxRyN9-VIA7h/logo/dark.svg?fit=max\u0026auto=format\u0026n=RMDLvxRyN9-VIA7h\u0026q=85\u0026s=f838d08af4bdbf4b9f80be89bbd57203"},"favicon":"https://mintcdn.com/clarityq/RMDLvxRyN9-VIA7h/favicon.svg?fit=max\u0026auto=format\u0026n=RMDLvxRyN9-VIA7h\u0026q=85\u0026s=ccd0c18ac98544dea1c3e42018f2db76","navbar":{"links":[{"href":"mailto:support@clarityq.ai","label":"Support"}]},"footer":{"socials":{"linkedin":"https://linkedin.com/company/clarityq"}},"seo":{"metatags":{"msvalidate.01":"2653DA8E28F50109EA5130713FEE874C"},"indexing":"all"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"clarityq","hasAudioNarration":false,"actualSubdomain":"clarityq","customDomains":["docs.clarityq.ai"],"gitSource":{"type":"github","owner":"clarityq","repo":"clarityq-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adf06d1861021733e4a2b32","collectionId":"6d05cb48-8ef9-4837-bcbc-3bcc8fef9e3a","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adf06d1861021733e4a2b32"},"entitlements":{},"buildId":"6adf06d1861021733e4a2b32","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"Context Layer","count":19},{"language":"default","tag":"Building the Context Layer","count":10},{"language":"default","tag":"Integrations","count":10},{"language":"default","tag":"Ask Anything","count":9},{"language":"default","tag":"Data Warehouse Connections","count":9},{"language":"default","tag":"API Reference","count":8},{"language":"default","tag":"Administration","count":7},{"language":"default","tag":"Semantic Catalog","count":6},{"language":"default","tag":"Event Catalog","count":5},{"language":"default","tag":"Dashboards","count":5}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"data-warehouse/clickhouse","slug":"/data-warehouse/clickhouse","pageMetadata":{"title":"ClickHouse","description":"Connect ClickHouse to ClarityQ","href":"/data-warehouse/clickhouse"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Connect ClickHouse to ClarityQ\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`setup`,children:`Setup`}),`\n`,_jsx(Heading,{level:`3`,id:`step-1-create-a-dedicated-user-for-clarityq`,children:`Step 1: Create a dedicated user for ClarityQ`}),`\n`,_jsxs(_components.p,{children:[`Connect to ClickHouse as an admin (a SQL client, or the `,_jsx(_components.strong,{children:`SQL Console`}),` on ClickHouse Cloud) and create a service account:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Create the ClarityQ user`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` USER`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` clarityq_user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` IDENTIFIED `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WITH`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sha256_password `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`BY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'your_secure_password'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`On ClickHouse Cloud you can instead issue a JWT for the account and use `,_jsx(_components.strong,{children:`Access Token`}),` authentication in Step 4.`]}),`\n`,_jsx(Heading,{level:`3`,id:`step-2-grant-database-permissions`,children:`Step 2: Grant database permissions`}),`\n`,_jsx(_components.p,{children:`Configure the required permissions for ClarityQ to discover schemas, query data, and cancel its own queries:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Grant read access to the databases ClarityQ should access`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` analytics.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` clarityq_user;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` events.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` clarityq_user;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Or grant access to specific tables only`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` analytics`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`orders`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` clarityq_user;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Grant query cancellation, so stopping a question stops the work on your server`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(query_id, user, query) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ON`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` system`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`processes`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` clarityq_user;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`ClickHouse filters its metadata views by these grants, so the account’s `,_jsx(_components.code,{children:`SELECT`}),` privileges determine which tables ClarityQ discovers.`]}),`\n`,_jsx(Heading,{level:`3`,id:`step-3-configure-network-access`,children:`Step 3: Configure network access`}),`\n`,_jsx(_components.p,{children:`Ensure your ClickHouse server allows connections from the following ClarityQ IP addresses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`44.218.213.75`}),`\n`,_jsx(_components.li,{children:`54.161.37.107`}),`\n`,_jsx(_components.li,{children:`54.208.212.67`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`On ClickHouse Cloud, select your service, go to `,_jsx(_components.strong,{children:`Settings`}),` → `,_jsx(_components.strong,{children:`Security`}),` and add these addresses to the `,_jsx(_components.strong,{children:`IP access list`}),`. A new service starts with no addresses allowed, so ClarityQ reaches it once they are added.`]}),`\n`,_jsxs(_components.p,{children:[`On a self-hosted server, allow inbound connections on the HTTP port (`,_jsx(_components.code,{children:`8443`}),` or `,_jsx(_components.code,{children:`8123`}),`) in your firewall or security group.`]}),`\n`,_jsx(Heading,{level:`3`,id:`step-4-configure-connection-in-clarityq`,children:`Step 4: Configure connection in ClarityQ`}),`\n`,_jsx(_components.p,{children:`In the ClarityQ interface, fill out the connection form with the following fields:`}),`\n`,_jsx(Heading,{level:`4`,id:`required-fields`,children:`Required Fields`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Connection Name`}),`: Choose a name for this connection (e.g., “Production ClickHouse”)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Host`}),`: Your ClickHouse hostname (e.g., `,_jsx(_components.code,{children:`your-instance.clickhouse.cloud`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Port`}),`: `,_jsx(_components.code,{children:`8443`}),` (default, pre-filled) for TLS, `,_jsx(_components.code,{children:`8123`}),` for plaintext HTTP`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Connect over TLS`}),`: Enabled (default). Disable it for a self-hosted server that serves the plaintext HTTP port on a private network`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`User`}),`: `,_jsx(_components.code,{children:`clarityq_user`}),` (the user you created in Step 1)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`optional-fields`,children:`Optional Fields`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Database`}),`: Leave empty to catalogue every database the user can read, or set it to confine ClarityQ to one database (e.g., `,_jsx(_components.code,{children:`analytics`}),`)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`authentication-type`,children:`Authentication Type`}),`\n`,_jsx(_components.p,{children:`Choose your authentication method using the toggle buttons:`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Password Authentication (default):`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Password`}),`: Enter the password you set for `,_jsx(_components.code,{children:`clarityq_user`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Access Token Authentication:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Access Token (JWT)`}),`: Paste a JWT issued for `,_jsx(_components.code,{children:`clarityq_user`}),` (ClickHouse Cloud)`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Set the `,_jsx(_components.strong,{children:`Port`}),` to match the transport whenever you toggle `,_jsx(_components.strong,{children:`Connect over TLS`}),`: ClickHouse serves TLS on `,_jsx(_components.code,{children:`8443`}),` and plaintext on `,_jsx(_components.code,{children:`8123`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`step-5-test-the-connection`,children:`Step 5: Test the connection`}),`\n`,_jsx(_components.p,{children:`Verify the connection in ClarityQ to ensure:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Authentication succeeds`}),`\n`,_jsxs(_components.li,{children:[`Databases are visible to `,_jsx(_components.code,{children:`clarityq_user`})]}),`\n`,_jsx(_components.li,{children:`Table metadata can be discovered`}),`\n`,_jsx(_components.li,{children:`Query execution works correctly`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`common-connection-issues`,children:`Common connection issues`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Connection times out`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Add the ClarityQ IP addresses to the Cloud IP access list, firewall or security group (see Step 3)`}),`\n`,_jsx(_components.li,{children:`Enter the hostname on its own, with the scheme and port left out of the field`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Connection refused or TLS handshake error`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Match the `,_jsx(_components.strong,{children:`Port`}),` to the transport: `,_jsx(_components.code,{children:`8443`}),` with `,_jsx(_components.strong,{children:`Connect over TLS`}),` enabled, `,_jsx(_components.code,{children:`8123`}),` with it disabled`]}),`\n`,_jsx(_components.li,{children:`Behind a proxy, use the port your ClickHouse URL uses`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Database not found`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Check the spelling of the `,_jsx(_components.strong,{children:`Database`}),` field against the databases listed in the error message`]}),`\n`,_jsx(_components.li,{children:`Clear the field to catalogue every database the user can read`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Database is not visible to the user`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Grant the user access to it: `,_jsx(_components.code,{children:`GRANT SELECT ON your_database.* TO clarityq_user`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`User has no grants on any database`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Grant `,_jsx(_components.code,{children:`SELECT`}),` on the databases ClarityQ should read (see Step 2)`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Cannot read system.databases`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Allow the user to read ClickHouse’s metadata views, which ClarityQ uses to discover schemas`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Authentication failed`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Re-enter the credential your server uses, either Password or Access Token — one credential is stored per connection`}),`\n`,_jsx(_components.li,{children:`For access tokens, issue a fresh JWT if the previous one has expired`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Tables missing after discovery`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Clear the `,_jsx(_components.strong,{children:`Database`}),` field to catalogue every database instead of the one you named`]}),`\n`,_jsxs(_components.li,{children:[`Grant the user `,_jsx(_components.code,{children:`SELECT`}),` on the missing databases`]}),`\n`,_jsxs(_components.li,{children:[`Query `,_jsx(_components.code,{children:`system`}),` and `,_jsx(_components.code,{children:`information_schema`}),` tables by name; they stay out of the catalog`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Stopping a question leaves the query running`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Grant `,_jsx(_components.code,{children:`SELECT(query_id, user, query) ON system.processes`}),` so ClarityQ can cancel with `,_jsx(_components.code,{children:`KILL QUERY`}),` (see Step 2)`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"ClickHouse","description":"Connect ClickHouse to ClarityQ","href":"/data-warehouse/clickhouse"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Setup","slug":"setup","depth":2,"children":[{"title":"Step 1: Create a dedicated user for ClarityQ","slug":"step-1-create-a-dedicated-user-for-clarityq","depth":3,"children":[]},{"title":"Step 2: Grant database permissions","slug":"step-2-grant-database-permissions","depth":3,"children":[]},{"title":"Step 3: Configure network access","slug":"step-3-configure-network-access","depth":3,"children":[]},{"title":"Step 4: Configure connection in ClarityQ","slug":"step-4-configure-connection-in-clarityq","depth":3,"children":[]},{"title":"Required Fields","slug":"required-fields","depth":4,"children":[]},{"title":"Optional Fields","slug":"optional-fields","depth":4,"children":[]},{"title":"Authentication Type","slug":"authentication-type","depth":4,"children":[]},{"title":"Step 5: Test the connection","slug":"step-5-test-the-connection","depth":3,"children":[]}]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"Common connection issues","slug":"common-connection-issues","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"clarityq","siteName":"ClarityQ Documentation","title":"ClickHouse - ClarityQ Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-28T13:22:51.615Z","originalFileLocation":"data-warehouse/clickhouse.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Connect ClickHouse to ClarityQ\">\u003cmeta data-mint-head name=\"application-name\" content=\"ClarityQ Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"ClickHouse - ClarityQ Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Connect ClickHouse to ClarityQ\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ClarityQ Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.clarityq.ai/data-warehouse/clickhouse\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://clarityq.mintlify.app/_mintlify/api/og/v2?division=Data+Warehouse+Connections\u0026amp;title=ClickHouse\u0026amp;description=Connect+ClickHouse+to+ClarityQ\u0026amp;theme=ff185c254d63b6c26b742940\u0026amp;signature=3ec797db57f3044d4a803924011ede8c1a96b0ad83b263c3a8efc2fac52d8b4e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"ClickHouse - ClarityQ Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Connect ClickHouse to ClarityQ\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://clarityq.mintlify.app/_mintlify/api/og/v2?division=Data+Warehouse+Connections\u0026amp;title=ClickHouse\u0026amp;description=Connect+ClickHouse+to+ClarityQ\u0026amp;theme=ff185c254d63b6c26b742940\u0026amp;signature=3ec797db57f3044d4a803924011ede8c1a96b0ad83b263c3a8efc2fac52d8b4e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/clarityq/YW4hrpKdd3h3lviU/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ClarityQ Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5A57FC\">\u003cmeta data-mint-head name=\"msvalidate.01\" content=\"2653DA8E28F50109EA5130713FEE874C\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.clarityq.ai/data-warehouse/clickhouse\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/data-warehouse/clickhouse.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.clarityq.ai/#organization\",\"name\":\"ClarityQ Documentation\",\"url\":\"https://docs.clarityq.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/clarityq/RMDLvxRyN9-VIA7h/logo/light.svg?fit=max\u0026auto=format\u0026n=RMDLvxRyN9-VIA7h\u0026q=85\u0026s=f8d4e57d3c0e50c3f720e5b6a7afef0b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.clarityq.ai#website\",\"name\":\"ClarityQ Documentation\",\"url\":\"https://docs.clarityq.ai\",\"publisher\":{\"@id\":\"https://docs.clarityq.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.clarityq.ai/data-warehouse/clickhouse#webpage\",\"url\":\"https://docs.clarityq.ai/data-warehouse/clickhouse\",\"name\":\"ClickHouse\",\"description\":\"Connect ClickHouse to ClarityQ\",\"dateModified\":\"2026-07-28T13:22:51.615Z\",\"isPartOf\":{\"@id\":\"https://docs.clarityq.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.clarityq.ai/data-warehouse/clickhouse#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.clarityq.ai/data-warehouse/clickhouse#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Data Warehouse Connections\",\"item\":\"https://docs.clarityq.ai/data-warehouse/bigquery\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ClickHouse\",\"item\":\"https://docs.clarityq.ai/data-warehouse/clickhouse\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.clarityq.ai/data-warehouse/clickhouse#article\",\"headline\":\"ClickHouse\",\"name\":\"ClickHouse\",\"description\":\"Connect ClickHouse to ClarityQ\",\"url\":\"https://docs.clarityq.ai/data-warehouse/clickhouse\",\"mainEntityOfPage\":{\"@id\":\"https://docs.clarityq.ai/data-warehouse/clickhouse#webpage\"},\"dateModified\":\"2026-07-28T13:22:51.615Z\",\"publisher\":{\"@id\":\"https://docs.clarityq.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.clarityq.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ClarityQ Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"ClarityQ Documentation","nav":{"global":null,"groups":[{"group":"Get Started","pages":[{"title":"What is ClarityQ?","href":"/get-started/what-is-clarityq"},{"title":"Connect Your Data Warehouse","href":"/get-started/connect-your-data-warehouse"},{"title":"Build Your Context Layer","href":"/get-started/build-your-context-layer"},{"title":"Your First Chat","href":"/get-started/your-first-chat"},{"title":"Best Practices","href":"/get-started/best-practices"}]},{"group":"Data Warehouse Connections","pages":[{"title":"BigQuery","href":"/data-warehouse/bigquery"},{"title":"Snowflake","href":"/data-warehouse/snowflake"},{"title":"Amazon Athena","href":"/data-warehouse/athena"},{"title":"Amazon Redshift","href":"/data-warehouse/redshift"},{"title":"PostgreSQL","href":"/data-warehouse/postgres"},{"title":"Databricks","href":"/data-warehouse/databricks"},{"title":"MaxCompute","href":"/data-warehouse/maxcompute"},{"title":"Trino","description":"Connect Trino to ClarityQ","href":"/data-warehouse/trino"},{"title":"ClickHouse","href":"/data-warehouse/clickhouse"}]},{"group":"Context Layer","pages":[{"title":"What is the Context Layer?","description":"The Context Layer teaches ClarityQ how your business thinks about its data.","href":"/context-layer/what-is-the-context-layer"},{"group":"Table Catalog","pages":[{"title":"What is the Table Catalog?","href":"/context-layer/table-catalog/what-is-the-table-catalog"},{"title":"Setting Up Your Table Catalog","href":"/context-layer/table-catalog/setting-up-your-table-catalog"},{"title":"Daily Discovery Jobs","href":"/context-layer/table-catalog/daily-discovery-jobs"}]},{"group":"Event Catalog","pages":[{"title":"What is the Event Catalog?","href":"/context-layer/event-catalog/what-is-the-event-catalog"},{"title":"Setting Up Your Event Catalog","href":"/context-layer/event-catalog/setting-up-your-event-catalog"},{"title":"Daily Discovery Jobs","href":"/context-layer/event-catalog/daily-discovery-jobs"},{"title":"Missing Description Wizard","href":"/context-layer/event-catalog/missing-description-wizard"},{"title":"Syncing Events to the Semantic Catalog","href":"/context-layer/event-catalog/syncing-events-to-the-semantic-catalog"}]},{"group":"Semantic Catalog","pages":[{"title":"What is the Semantic Catalog?","href":"/context-layer/semantic-catalog/what-is-the-semantic-catalog"},{"title":"Entities","href":"/context-layer/semantic-catalog/entities"},{"title":"Dimensions","href":"/context-layer/semantic-catalog/dimensions"},{"title":"Metrics","href":"/context-layer/semantic-catalog/metrics"},{"title":"Segments","href":"/context-layer/semantic-catalog/segments"},{"title":"Features","href":"/context-layer/semantic-catalog/features"}]},{"title":"Skills","href":"/context-layer/skills"},{"title":"Rules","href":"/context-layer/rules"},{"title":"Memory","href":"/context-layer/memory"},{"title":"Files","href":"/context-layer/files"}]},{"group":"Building the Context Layer","pages":[{"title":"Recommended Build Order","href":"/context-layer/building/recommended-build-order"},{"title":"How the Context Layer Builder works","href":"/context-layer/building/how-the-context-layer-builder-works"},{"title":"Building Entities from Tables","href":"/context-layer/building/building-entities-from-tables"},{"title":"Building Metrics","href":"/context-layer/building/building-metrics"},{"title":"Building Segments","href":"/context-layer/building/building-segments"},{"title":"Building Skills","href":"/context-layer/building/building-skills"},{"title":"Building Product Memory","href":"/context-layer/building/building-memory"},{"title":"Context Layer Versioning","href":"/context-layer/building/context-layer-versioning"},{"title":"Inbox","href":"/context-layer/building/inbox"},{"title":"Building Features from the Event Catalog","href":"/context-layer/building/building-features-from-the-event-catalog"}]},{"group":"Ask Anything","pages":[{"title":"How Ask Anything Works","href":"/ask-anything/how-ask-anything-works"},{"title":"Asking Questions","href":"/ask-anything/asking-questions"},{"title":"Understanding Responses","href":"/ask-anything/understanding-responses"},{"title":"Diagnosing Answers","href":"/ask-anything/diagnosing-answers"},{"title":"Context Coverage","href":"/ask-anything/context-coverage"},{"title":"Sharing \u0026 Collaboration","href":"/ask-anything/sharing-and-collaboration"},{"title":"Unified Workspaces","href":"/ask-anything/unified-workspaces"},{"title":"Connecting Your Data Warehouse Account","href":"/ask-anything/connecting-your-data-warehouse-account"},{"title":"Errors \u0026 Troubleshooting","href":"/ask-anything/errors-and-troubleshooting"}]},{"group":"Dashboards","pages":[{"title":"What are Dashboards?","href":"/dashboards/what-are-dashboards"},{"title":"Creating and Editing Dashboards","href":"/dashboards/creating-and-editing-dashboards"},{"title":"Asking About a Dashboard's Data","href":"/dashboards/asking-about-dashboard-data"},{"title":"Scheduling Dashboards","href":"/dashboards/scheduling-dashboards"},{"title":"Sharing and Managing Dashboards","href":"/dashboards/sharing-and-managing-dashboards"}]},{"group":"Automations","pages":[{"title":"What are Tasks?","href":"/automations/what-are-tasks"},{"title":"Creating \u0026 Scheduling Tasks","href":"/automations/creating-and-scheduling-tasks"},{"title":"Task Delivery \u0026 Notifications","href":"/automations/task-delivery-and-notifications"}]},{"group":"Integrations","pages":[{"group":"Embed","pages":[{"title":"Embedding ClarityQ","href":"/integrations/embed/embedding-clarityq"},{"openapi":"post /api/v1/products/{product_id}/embed/token","title":"Mint an embed token","href":"/integrations/embed/mint-embed-token"},{"openapi":"post /api/v1/products/{product_id}/conversations","title":"List conversations","href":"/integrations/embed/list-conversations"}]},{"group":"Slack","pages":[{"title":"Connecting Slack","href":"/integrations/slack/connecting-slack"},{"title":"Using ClarityQ in Slack","href":"/integrations/slack/using-clarityq-in-slack"}]},{"group":"MCP Connectors","pages":[{"title":"MCP Connectors","href":"/integrations/mcp/connecting-mcp-servers"},{"title":"Using Apps","href":"/integrations/mcp/using-mcp-servers"},{"title":"Connecting Atlassian (Jira)","href":"/integrations/mcp/connecting-atlassian"}]},{"group":"ClarityQ MCP Server","pages":[{"title":"Connecting AI Assistants","href":"/integrations/clarityq-mcp-server/connecting-ai-assistants"},{"title":"Using ClarityQ from AI Assistants","href":"/integrations/clarityq-mcp-server/using-clarityq-from-ai-assistants"}]}]},{"group":"Administration","pages":[{"title":"Context Hub","href":"/admin/context-hub"},{"title":"User Management and Roles","href":"/admin/user-management-and-roles"},{"title":"Organization Settings","href":"/admin/organization-settings"},{"title":"Filters","href":"/admin/filters"},{"title":"Usage Dashboard","href":"/admin/usage-dashboard"},{"title":"Usage Limits and Top-Ups","href":"/admin/usage-limits-and-top-ups"},{"title":"Security and Compliance","href":"/admin/security-and-compliance"}]},{"group":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/index"},{"openapi":"post /api/v1/products/{product_id}/ask","title":"Ask a question","href":"/api-reference/api/ask-a-question"},{"openapi":"get /api/v1/products/{product_id}/conversations/{conversation_id}/status","title":"Get conversation status","href":"/api-reference/api/get-conversation-status"},{"openapi":"get /api/v1/products/{product_id}/conversations/{conversation_id}/summary","title":"Get conversation summary","href":"/api-reference/api/get-conversation-summary"},{"title":"Submit Feedback","openapi":"put /api/v1/products/{product_id}/conversations/{conversation_id}/feedback","href":"/api-reference/api/submit-feedback"},{"openapi":"get /api/v1/products/{product_id}/tasks/{task_id}/last-run-summary","title":"Get last completed task run summary","href":"/api-reference/api/get-last-completed-task-run-summary"},{"title":"Get Prompt Usage","openapi":"get /api/v1/products/{product_id}/usage/prompts","href":"/api-reference/api/get-prompt-usage"},{"title":"Submit External Feedback","openapi":"post /api/v1/products/{product_id}/external-feedback","href":"/api-reference/api/submit-external-feedback"}]}]},"title":"ClickHouse - ClarityQ Documentation","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":[],"chunks":[]}