blob: f40f4d5fa4eccf9d018ccc835f2683d5fb65f1bd [file] [log] [blame]
"use strict";(self.webpackChunkdocs_v_2=self.webpackChunkdocs_v_2||[]).push([[8005],{3905:function(e,t,r){r.d(t,{Zo:function(){return u},kt:function(){return h}});var n=r(67294);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 c(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(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={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,c=e.originalType,l=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),d=s(r),h=o,f=d["".concat(l,".").concat(h)]||d[h]||p[h]||c;return r?n.createElement(f,a(a({ref:t},u),{},{components:r})):n.createElement(f,a({ref:t},u))}));function h(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var c=r.length,a=new Array(c);a[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:o,a[1]=i;for(var s=2;s<c;s++)a[s]=r[s];return n.createElement.apply(null,a)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},20672:function(e,t,r){r.r(t),r.d(t,{frontMatter:function(){return i},contentTitle:function(){return l},metadata:function(){return s},toc:function(){return u},default:function(){return d}});var n=r(83117),o=r(80102),c=(r(67294),r(3905)),a=["components"],i={title:"Clickhouse",hide_title:!0,sidebar_position:15,version:1},l=void 0,s={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",editUrl:"https://github.com/apache/superset/tree/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"}},u=[{value:"Clickhouse",id:"clickhouse",children:[],level:2}],p={toc:u};function d(e){var t=e.components,r=(0,o.Z)(e,a);return(0,c.kt)("wrapper",(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,c.kt)("h2",{id:"clickhouse"},"Clickhouse"),(0,c.kt)("p",null,"To use Clickhouse with Superset, you will need to add the following Python libraries:"),(0,c.kt)("pre",null,(0,c.kt)("code",{parentName:"pre"},"clickhouse-driver==0.2.0\nclickhouse-sqlalchemy==0.1.6\n")),(0,c.kt)("p",null,"If running Superset using Docker Compose, add the following to your ",(0,c.kt)("inlineCode",{parentName:"p"},"./docker/requirements-local.txt")," file:"),(0,c.kt)("pre",null,(0,c.kt)("code",{parentName:"pre"},"clickhouse-driver>=0.2.0\nclickhouse-sqlalchemy>=0.1.6\n")),(0,c.kt)("p",null,"The recommended connector library for Clickhouse is\n",(0,c.kt)("a",{parentName:"p",href:"https://github.com/cloudflare/sqlalchemy-clickhouse"},"sqlalchemy-clickhouse"),"."),(0,c.kt)("p",null,"The expected connection string is formatted as follows:"),(0,c.kt)("pre",null,(0,c.kt)("code",{parentName:"pre"},"clickhouse+native://<user>:<password>@<host>:<port>/<database>[?options\u2026]clickhouse://{username}:{password}@{hostname}:{port}/{database}\n")),(0,c.kt)("p",null,"Here's a concrete example of a real connection string:"),(0,c.kt)("pre",null,(0,c.kt)("code",{parentName:"pre"},"clickhouse+native://demo:demo@github.demo.trial.altinity.cloud/default?secure=true\n")),(0,c.kt)("p",null,"If you're using Clickhouse locally on your computer, you can get away with using a native protocol URL that\nuses the default user without a password (and doesn't encrypt the connection):"),(0,c.kt)("pre",null,(0,c.kt)("code",{parentName:"pre"},"clickhouse+native://localhost/default\n")))}d.isMDXComponent=!0}}]);