mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-08 16:48:17 +00:00
Add snowflake
This commit is contained in:
parent
d12497a3ff
commit
cbbdf0930a
@ -173,6 +173,23 @@ source:
|
||||
# table_pattern is same as above
|
||||
```
|
||||
|
||||
## Snowflake `snowflake`
|
||||
Extracts:
|
||||
- List of databases, schema, and tables
|
||||
- Column types associated with each table
|
||||
|
||||
Extra requirements: `pip install snowflake-sqlalchemy`
|
||||
|
||||
```yml
|
||||
source:
|
||||
type: snowflake
|
||||
config:
|
||||
username: user
|
||||
password: pass
|
||||
host_port: account_name
|
||||
# table_pattern is same as above
|
||||
```
|
||||
|
||||
## File `file`
|
||||
Pulls metadata from a previously generated file. Note that the file sink
|
||||
can produce such files, and a number of samples are included in the
|
||||
|
@ -10,12 +10,14 @@ from .mssql import SQLServerSource
|
||||
from .mysql import MySQLSource
|
||||
from .hive import HiveSource
|
||||
from .postgres import PostgresSource
|
||||
from .snowflake import SnowflakeSource
|
||||
|
||||
source_class_mapping: Dict[str, Type[Source]] = {
|
||||
"mssql": SQLServerSource,
|
||||
"mysql": MySQLSource,
|
||||
"hive": HiveSource,
|
||||
"postgres": PostgresSource,
|
||||
"snowflake": SnowflakeSource,
|
||||
"kafka": KafkaSource,
|
||||
# "ldap": LDAPSource,
|
||||
"file": MetadataFileSource,
|
||||
|
16
metadata-ingestion/src/gometa/ingestion/source/snowflake.py
Normal file
16
metadata-ingestion/src/gometa/ingestion/source/snowflake.py
Normal file
@ -0,0 +1,16 @@
|
||||
from .sql_common import SQLAlchemyConfig, SQLAlchemySource
|
||||
|
||||
|
||||
class SnowflakeConfig(SQLAlchemyConfig):
|
||||
# defaults
|
||||
scheme = "snowflake"
|
||||
|
||||
|
||||
class SnowflakeSource(SQLAlchemySource):
|
||||
def __init__(self, config, ctx):
|
||||
super().__init__(config, ctx, "snowflake")
|
||||
|
||||
@classmethod
|
||||
def create(cls, config_dict, ctx):
|
||||
config = SnowflakeConfig.parse_obj(config_dict)
|
||||
return cls(config, ctx)
|
Loading…
x
Reference in New Issue
Block a user