blob: dfac379664f4540929648d4e61a720736dfa2e81 [file] [log] [blame]
{"version":3,"sources":["webpack:///./src/pages/docs/Connecting to Databases/druid.mdx"],"names":["_frontmatter","layoutProps","MDXLayout","DefaultLayout","MDXContent","components","props","mdxType","parentName","src","isMDXComponent"],"mappings":"wPAQaA,G,UAAe,S,kOAC5B,IAAMC,EAAc,CAClBD,gBAEIE,EAAYC,IACH,SAASC,EAAT,GAGZ,IAFDC,EAEC,EAFDA,WACGC,EACF,8BACD,OAAO,YAACJ,EAAD,eAAeD,EAAiBK,EAAhC,CAAuCD,WAAYA,EAAYE,QAAQ,cAG5E,iBAAQ,CACN,GAAM,gBADR,gBAGA,oFAAmE,0BAAYC,WAAW,KAAvB,mBAAnE,iHAEF,6BAAGA,WAAW,KAAQ,CAChB,KAAQ,sCADd,mBAFE,KAKA,0DACA,uBAAK,gCAAMA,WAAW,OAAU,IAA3B,wEAEL,iBAAQ,CACN,GAAM,gCADR,gCAGA,yHACF,sBAAQA,WAAW,KAAnB,gBADE,UAEA,qBAAG,sBAAQA,WAAW,KAAnB,uBACH,wDAAuC,sBAAQA,WAAW,KAAnB,oBAAvC,kEAEA,mBAAKC,IAAI,kCAAmC,IAC5C,sGACA,qBAAG,sBAAQD,WAAW,KAAnB,6BACH,8EAA6D,sBAAQA,WAAW,KAAnB,UAA7D,WACA,uBAAK,gCAAMA,WAAW,OAAU,IAA3B,2FAIL,iBAAQ,CACN,GAAM,gBADR,gBAGA,wMACyE,sBAAQA,WAAW,KAAnB,qGADzE,MAGA,8PAE8B,sBAAQA,WAAW,KAAnB,qBAF9B,oCAGA,6LACiE,sBAAQA,WAAW,KAAnB,qBADjE,wCAGA,iBAAQ,CACN,GAAM,qBADR,qBAGA,4LAC8D,0BAAYA,WAAW,KAAvB,WAD9D,SAC2H,0BAAYA,WAAW,KAAvB,eAD3H,mI,gOAQJJ,EAAWM,gBAAiB","file":"component---src-pages-docs-connecting-to-databases-druid-mdx-cc8ab061aef7eefcef20.js","sourcesContent":["import * as React from 'react'\n /* @jsx mdx */\nimport { mdx } from '@mdx-js/react';\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\n\nimport DefaultLayout from \"/home/runner/work/superset/superset/docs/node_modules/gatsby-theme-docz/src/base/Layout.js\";\nexport const _frontmatter = {};\nconst layoutProps = {\n _frontmatter\n};\nconst MDXLayout = DefaultLayout;\nexport default function MDXContent({\n components,\n ...props\n}) {\n return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n\n\n <h2 {...{\n \"id\": \"apache-druid\"\n }}>{`Apache Druid`}</h2>\n <p>{`A native connector to Druid ships with Superset (behind the `}<inlineCode parentName=\"p\">{`DRUID_IS_ACTIVE`}</inlineCode>{` flag) but this is\nslowly getting deprecated in favor of SQLAlchemy / DBAPI connector made available in the\n`}<a parentName=\"p\" {...{\n \"href\": \"https://pythonhosted.org/pydruid/\"\n }}>{`pydruid library`}</a>{`.`}</p>\n <p>{`The connection string looks like:`}</p>\n <pre><code parentName=\"pre\" {...{}}>{`druid://<User>:<password>@<Host>:<Port-default-9088>/druid/v2/sql\n`}</code></pre>\n <h3 {...{\n \"id\": \"customizing-druid-connection\"\n }}>{`Customizing Druid Connection`}</h3>\n <p>{`When adding a connection to Druid, you can customize the connection a few different ways in the\n`}<strong parentName=\"p\">{`Add Database`}</strong>{` form.`}</p>\n <p><strong parentName=\"p\">{`Custom Certificate`}</strong></p>\n <p>{`You can add certificates in the `}<strong parentName=\"p\">{`Root Certificate`}</strong>{` field when configuring the new database\nconnection to Druid:`}</p>\n <img src=\"/images/root-cert-example.png\" />{' '}\n <p>{`When using a custom certificate, pydruid will automatically use https scheme.`}</p>\n <p><strong parentName=\"p\">{`Disable SSL Verification`}</strong></p>\n <p>{`To disable SSL verification, add the following to the `}<strong parentName=\"p\">{`Extras`}</strong>{` field:`}</p>\n <pre><code parentName=\"pre\" {...{}}>{`engine_params:\n{\"connect_args\":\n {\"scheme\": \"https\", \"ssl_verify_cert\": false}}\n`}</code></pre>\n <h3 {...{\n \"id\": \"aggregations\"\n }}>{`Aggregations`}</h3>\n <p>{`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 (`}<strong parentName=\"p\">{`Sources -> Druid\nDatasources -> `}{`[your datasource]`}{` -> Edit -> `}{`[tab]`}{` List Druid Column`}</strong>{`).`}</p>\n <p>{`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 `}<strong parentName=\"p\">{`List Druid Metric`}</strong>{` tab upon saving the datasource.`}</p>\n <p>{`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 `}<strong parentName=\"p\">{`List Druid Metric`}</strong>{` tab\nfollowing Druid documentation.`}</p>\n <h3 {...{\n \"id\": \"post-aggregations\"\n }}>{`Post-Aggregations`}</h3>\n <p>{`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 `}<inlineCode parentName=\"p\">{`postagg`}</inlineCode>{` as a `}<inlineCode parentName=\"p\">{`Metric Type`}</inlineCode>{`. You\nthen have to provide a valid json post-aggregation definition (as specified in the Druid docs) in\nthe JSON field.`}</p>\n\n </MDXLayout>;\n}\n;\nMDXContent.isMDXComponent = true;\n "],"sourceRoot":""}