blob: f71f072ce6091229d7ea6ba30b620816b0cf3c2f [file] [log] [blame]
"use strict";(self.webpackChunkdocs_v_2=self.webpackChunkdocs_v_2||[]).push([[7642],{15680:(e,t,r)=>{r.d(t,{xA:()=>u,yg:()=>f});var n=r(96540);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=n.createContext({}),l=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},u=function(e){var t=l(e.components);return n.createElement(s.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},y=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=l(r),y=o,f=p["".concat(s,".").concat(y)]||p[y]||d[y]||a;return r?n.createElement(f,c(c({ref:t},u),{},{components:r})):n.createElement(f,c({ref:t},u))}));function f(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,c=new Array(a);c[0]=y;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:o,c[1]=i;for(var l=2;l<a;l++)c[l]=r[l];return n.createElement.apply(null,c)}return n.createElement.apply(null,r)}y.displayName="MDXCreateElement"},80429:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var n=r(58168),o=(r(96540),r(15680));const a={title:"ClickHouse",hide_title:!0,sidebar_position:15,version:1},c=void 0,i={unversionedId:"databases/clickhouse",id:"databases/clickhouse",title:"ClickHouse",description:"ClickHouse",source:"@site/docs/databases/clickhouse.mdx",sourceDirName:"databases",slug:"/databases/clickhouse",permalink:"/docs/databases/clickhouse",draft:!1,editUrl:"https://github.com/apache/superset/edit/master/docs/docs/databases/clickhouse.mdx",tags:[],version:"current",sidebarPosition:15,frontMatter:{title:"ClickHouse",hide_title:!0,sidebar_position:15,version:1},sidebar:"tutorialSidebar",previous:{title:"Apache Spark SQL",permalink:"/docs/databases/spark-sql"},next:{title:"CockroachDB",permalink:"/docs/databases/cockroachdb"}},s={},l=[{value:"ClickHouse",id:"clickhouse",level:2}],u={toc:l},p="wrapper";function d(e){let{components:t,...r}=e;return(0,o.yg)(p,(0,n.A)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("h2",{id:"clickhouse"},"ClickHouse"),(0,o.yg)("p",null,"To use ClickHouse with Superset, you will need to add the following Python library:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre"},"clickhouse-connect>=0.6.8\n")),(0,o.yg)("p",null,"If running Superset using Docker Compose, add the following to your ",(0,o.yg)("inlineCode",{parentName:"p"},"./docker/requirements-local.txt")," file:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre"},"clickhouse-connect>=0.6.8\n")),(0,o.yg)("p",null,"The recommended connector library for ClickHouse is\n",(0,o.yg)("a",{parentName:"p",href:"https://github.com/ClickHouse/clickhouse-connect"},"clickhouse-connect"),"."),(0,o.yg)("p",null,"The expected connection string is formatted as follows:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre"},"clickhousedb://<user>:<password>@<host>:<port>/<database>[?options\u2026]clickhouse://{username}:{password}@{hostname}:{port}/{database}\n")),(0,o.yg)("p",null,"Here's a concrete example of a real connection string:"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre"},"clickhousedb://demo:demo@github.demo.trial.altinity.cloud/default?secure=true\n")),(0,o.yg)("p",null,"If you're using Clickhouse locally on your computer, you can get away with using a http protocol URL that\nuses the default user without a password (and doesn't encrypt the connection):"),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre"},"clickhousedb://localhost/default\n")))}d.isMDXComponent=!0}}]);