Fix #1073: Apache Druid Support (#1424)

* Fix #1073: Apache Druid Support
This commit is contained in:
Sriharsha Chintalapani 2021-11-29 10:59:15 -08:00 committed by GitHub
parent c2efcb1107
commit 7009a0bc12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 1 deletions

View File

@ -22,7 +22,8 @@
"Trino", "Trino",
"Vertica", "Vertica",
"Glue", "Glue",
"MariaDB" "MariaDB",
"Druid"
], ],
"javaEnums": [ "javaEnums": [
{ {
@ -66,6 +67,9 @@
}, },
{ {
"name": "MariaDB" "name": "MariaDB"
},
{
"name": "Druid"
} }
] ]
} }

View File

@ -79,6 +79,7 @@ plugins: Dict[str, Set[str]] = {
"bigquery-usage": {"google-cloud-logging", "cachetools"}, "bigquery-usage": {"google-cloud-logging", "cachetools"},
"docker": {"docker==5.0.3"}, "docker": {"docker==5.0.3"},
"dbt": {}, "dbt": {},
"druid": {"pydruid>=0.6.2"},
"elasticsearch": {"elasticsearch~=7.13.1"}, "elasticsearch": {"elasticsearch~=7.13.1"},
"glue": {"boto3~=1.19.12"}, "glue": {"boto3~=1.19.12"},
"hive": { "hive": {

View File

@ -0,0 +1,27 @@
from typing import Optional
import pydruid
from metadata.ingestion.ometa.openmetadata_rest import MetadataServerConfig
from metadata.ingestion.source.sql_source import SQLConnectionConfig, SQLSource
class DruidConfig(SQLConnectionConfig):
scheme = "druid"
auth_options: Optional[str] = None
service_type = "Druid"
def get_connection_url(self):
url = super().get_connection_url()
return f"{url}/druid/v2/sql"
class DruidSource(SQLSource):
def __init__(self, config, metadata_config, ctx):
super().__init__(config, metadata_config, ctx)
@classmethod
def create(cls, config_dict, metadata_config_dict, ctx):
config = DruidConfig.parse_obj(config_dict)
metadata_config = MetadataServerConfig.parse_obj(metadata_config_dict)
return cls(config, metadata_config, ctx)