feat(ingest): add Oracle db support (#2347)

This commit is contained in:
Harshal Sheth 2021-04-06 15:38:25 -07:00 committed by GitHub
parent 7c84faab2f
commit cfc02ee196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

View File

@ -41,6 +41,7 @@ We use a plugin architecture so that you can install only the dependencies you a
| mssql | `pip install 'acryl-datahub[mssql]'` | SQL Server source |
| mysql | `pip install 'acryl-datahub[mysql]'` | MySQL source |
| postgres | `pip install 'acryl-datahub[postgres]'` | Postgres source |
| oracle | `pip install 'acryl-datahub[oracle]'` | Oracle source |
| snowflake | `pip install 'acryl-datahub[snowflake]'` | Snowflake source |
| mongodb | `pip install 'acryl-datahub[mongodb]'` | MongoDB source |
| ldap | `pip install 'acryl-datahub[ldap]'` ([extra requirements]) | LDAP source |
@ -264,6 +265,28 @@ source:
# options is same as above
```
### Oracle `oracle`
Extracts:
- List of databases, schema, and tables
- Column types associated with each table
```yml
source:
type: oracle
config:
# For more details on authentication, see the documentation:
# https://docs.sqlalchemy.org/en/14/dialects/oracle.html#dialect-oracle-cx_oracle-connect and
# https://cx-oracle.readthedocs.io/en/latest/user_guide/connection_handling.html#connection-strings.
username: user
password: pass
host_port: localhost:5432
database: dbname
# table_pattern/schema_pattern is same as above
# options is same as above
```
### Google BigQuery `bigquery`
Extracts:

View File

@ -74,6 +74,7 @@ plugins: Dict[str, Set[str]] = {
"mysql": sql_common | {"pymysql>=1.0.2"},
"postgres": sql_common | {"psycopg2-binary", "GeoAlchemy2"},
"snowflake": sql_common | {"snowflake-sqlalchemy"},
"oracle": sql_common | {"cx_Oracle"},
"ldap": {"python-ldap>=2.4"},
"druid": sql_common | {"pydruid>=0.6.2"},
"mongodb": {"pymongo>=3.11"},
@ -176,6 +177,7 @@ setuptools.setup(
"mongodb = datahub.ingestion.source.mongodb:MongoDBSource",
"mssql = datahub.ingestion.source.mssql:SQLServerSource",
"mysql = datahub.ingestion.source.mysql:MySQLSource",
"oracle = datahub.ingestion.source.oracle:OracleSource",
"postgres = datahub.ingestion.source.postgres:PostgresSource",
"snowflake = datahub.ingestion.source.snowflake:SnowflakeSource",
],

View File

@ -0,0 +1,19 @@
# This import verifies that the dependencies are available.
import cx_Oracle # noqa: F401
from .sql_common import BasicSQLAlchemyConfig, SQLAlchemySource
class OracleConfig(BasicSQLAlchemyConfig):
# defaults
scheme = "oracle+cx_oracle"
class OracleSource(SQLAlchemySource):
def __init__(self, config, ctx):
super().__init__(config, ctx, "oracle")
@classmethod
def create(cls, config_dict, ctx):
config = OracleConfig.parse_obj(config_dict)
return cls(config, ctx)