blob: 87c4011cbba1cc49c722250b7b9392b04c72bf2d [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{QhTc:function(e,t,n){"use strict";n.r(t),n.d(t,"_frontmatter",(function(){return c})),n.d(t,"default",(function(){return d}));var i=n("k1TG"),a=n("8o2o"),o=(n("q1tI"),n("7ljp")),r=n("hhGP"),c=(n("qKvR"),{});void 0!==c&&c&&c===Object(c)&&Object.isExtensible(c)&&!c.hasOwnProperty("__filemeta")&&Object.defineProperty(c,"__filemeta",{configurable:!0,value:{name:"_frontmatter",filename:"src/pages/docs/Connecting to Databases/druid.mdx"}});var s={_frontmatter:c},b=r.a;function d(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(o.b)(b,Object(i.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"apache-druid"},"Apache Druid"),Object(o.b)("p",null,"A native connector to Druid ships with Superset (behind the ",Object(o.b)("inlineCode",{parentName:"p"},"DRUID_IS_ACTIVE")," flag) but this is\nslowly getting deprecated in favor of SQLAlchemy / DBAPI connector made available in the\n",Object(o.b)("a",Object(i.a)({parentName:"p"},{href:"https://pythonhosted.org/pydruid/"}),"pydruid library"),"."),Object(o.b)("p",null,"The connection string looks like:"),Object(o.b)("pre",null,Object(o.b)("code",Object(i.a)({parentName:"pre"},{}),"druid://<User>:<password>@<Host>:<Port-default-9088>/druid/v2/sql\n")),Object(o.b)("h3",{id:"customizing-druid-connection"},"Customizing Druid Connection"),Object(o.b)("p",null,"When adding a connection to Druid, you can customize the connection a few different ways in the\n",Object(o.b)("strong",{parentName:"p"},"Add Database")," form."),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Custom Certificate")),Object(o.b)("p",null,"You can add certificates in the ",Object(o.b)("strong",{parentName:"p"},"Root Certificate")," field when configuring the new database\nconnection to Druid:"),Object(o.b)("img",{src:"/images/root-cert-example.png"})," ",Object(o.b)("p",null,"When using a custom certificate, pydruid will automatically use https scheme."),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Disable SSL Verification")),Object(o.b)("p",null,"To disable SSL verification, add the following to the ",Object(o.b)("strong",{parentName:"p"},"Extras")," field:"),Object(o.b)("pre",null,Object(o.b)("code",Object(i.a)({parentName:"pre"},{}),'engine_params:\n{"connect_args":\n {"scheme": "https", "ssl_verify_cert": false}}\n')),Object(o.b)("h3",{id:"aggregations"},"Aggregations"),Object(o.b)("p",null,"Common aggregations or Druid metrics can be defined and used in Superset. The first and simpler use\ncase is to use the checkbox matrix exposed in your datasource’s edit view (",Object(o.b)("strong",{parentName:"p"},"Sources -> Druid\nDatasources -> ","[your datasource]"," -> Edit -> ","[tab]"," List Druid Column"),")."),Object(o.b)("p",null,"Clicking the GroupBy and Filterable checkboxes will make the column appear in the related dropdowns\nwhile in the Explore view. Checking Count Distinct, Min, Max or Sum will result in creating new\nmetrics that will appear in the ",Object(o.b)("strong",{parentName:"p"},"List Druid Metric")," tab upon saving the datasource."),Object(o.b)("p",null,"By editing these metrics, you’ll notice that their JSON element corresponds to Druid aggregation\ndefinition. You can create your own aggregations manually from the ",Object(o.b)("strong",{parentName:"p"},"List Druid Metric")," tab\nfollowing Druid documentation."),Object(o.b)("h3",{id:"post-aggregations"},"Post-Aggregations"),Object(o.b)("p",null,"Druid supports post aggregation and this works in Superset. All you have to do is create a metric,\nmuch like you would create an aggregation manually, but specify ",Object(o.b)("inlineCode",{parentName:"p"},"postagg")," as a ",Object(o.b)("inlineCode",{parentName:"p"},"Metric Type"),". You\nthen have to provide a valid json post-aggregation definition (as specified in the Druid docs) in\nthe JSON field."))}void 0!==d&&d&&d===Object(d)&&Object.isExtensible(d)&&!d.hasOwnProperty("__filemeta")&&Object.defineProperty(d,"__filemeta",{configurable:!0,value:{name:"MDXContent",filename:"src/pages/docs/Connecting to Databases/druid.mdx"}}),d.isMDXComponent=!0}}]);
//# sourceMappingURL=component---src-pages-docs-connecting-to-databases-druid-mdx-cc8ab061aef7eefcef20.js.map