Add snowflake

This commit is contained in:
Harshal Sheth 2021-02-15 12:21:06 -08:00 committed by Shirshanka Das
parent d12497a3ff
commit cbbdf0930a
3 changed files with 35 additions and 0 deletions

View File

@ -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

View File

@ -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,

View 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)