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 # 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` ## File `file`
Pulls metadata from a previously generated file. Note that the file sink 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 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 .mysql import MySQLSource
from .hive import HiveSource from .hive import HiveSource
from .postgres import PostgresSource from .postgres import PostgresSource
from .snowflake import SnowflakeSource
source_class_mapping: Dict[str, Type[Source]] = { source_class_mapping: Dict[str, Type[Source]] = {
"mssql": SQLServerSource, "mssql": SQLServerSource,
"mysql": MySQLSource, "mysql": MySQLSource,
"hive": HiveSource, "hive": HiveSource,
"postgres": PostgresSource, "postgres": PostgresSource,
"snowflake": SnowflakeSource,
"kafka": KafkaSource, "kafka": KafkaSource,
# "ldap": LDAPSource, # "ldap": LDAPSource,
"file": MetadataFileSource, "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)