incalculable-ocean-74010
03/12/2021, 3:10 PMincalculable-ocean-74010
03/12/2021, 3:13 PM# This import verifies that the dependencies are available.
import pydruid # noqa: F401
from .sql_common import BasicSQLAlchemyConfig, SQLAlchemySource
class DruidConfig(BasicSQLAlchemyConfig):
# defaults
scheme = "druid"
def get_sql_alchemy_url(self):
return f"{BasicSQLAlchemyConfig.get_sql_alchemy_url(self)}/druid/v2/sql/"
class DruidSource(SQLAlchemySource):
def __init__(self, config, ctx):
super().__init__(config, ctx, "druid")
@classmethod
def create(cls, config_dict, ctx):
config = DruidConfig.parse_obj(config_dict)
return cls(config, ctx)
and registering this new source class I get the following when crawling it:
# datahub ingest -c druid_to_console.yml
[2021-03-12 15:09:04,996] DEBUG {datahub.entrypoints:64} - Using config: {'source': {'type': 'druid', 'config': {'host_port': '<omitted url>'}}, 'sink': {'type': 'file', 'config': {'filename': './druid.json'}}}
[2021-03-12 15:09:04,996] DEBUG {datahub.ingestion.run.pipeline:63} - Source type:druid,<class 'datahub.ingestion.source.druid.DruidSource'> configured
[2021-03-12 15:09:04,996] INFO {datahub.ingestion.sink.file:27} - Will write to druid.json
[2021-03-12 15:09:04,996] DEBUG {datahub.ingestion.run.pipeline:69} - Sink type:file,<class 'datahub.ingestion.sink.file.FileSink'> configured
[2021-03-12 15:09:04,996] DEBUG {datahub.ingestion.source.sql_common:172} - sql_alchemy_url=<omitted url>
[2021-03-12 15:09:05,466] DEBUG {datahub.ingestion.run.pipeline:38} - sink called success callback
[2021-03-12 15:09:05,560] DEBUG {datahub.ingestion.run.pipeline:38} - sink called success callback
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/result.py", line 1215, in _fetchone_impl
return self.cursor.fetchone()
AttributeError: 'NoneType' object has no attribute 'fetchone'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/datahub", line 33, in <module>
sys.exit(load_entry_point('datahub', 'console_scripts', 'datahub')())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
incalculable-ocean-74010
03/12/2021, 3:26 PMgray-shoe-75895
03/12/2021, 4:34 PMgray-shoe-75895
03/12/2021, 4:35 PMincalculable-ocean-74010
03/12/2021, 4:46 PMgray-shoe-75895
03/12/2021, 4:47 PMgray-shoe-75895
03/12/2021, 4:51 PMincalculable-ocean-74010
03/12/2021, 5:45 PMgray-shoe-75895
03/12/2021, 9:23 PMincalculable-ocean-74010
03/15/2021, 11:12 AM