From b88aa2c386f60430d5f955cfda427db7be04ffb9 Mon Sep 17 00:00:00 2001 From: neojunjie Date: Mon, 2 Oct 2023 20:14:16 +0800 Subject: [PATCH] workaround for oracle.py --- metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py | 4 ++-- metadata-ingestion/tests/integration/oracle/common.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py b/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py index f2e1fe00ec8a3..c16057ae3262a 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py @@ -110,7 +110,7 @@ def __init__(self, inspector_instance: Inspector): def get_schema_names(self) -> List[str]: logger.debug("OracleInspectorObjectWrapper is in used") - s = "SELECT username FROM dba_users ORDER BY username" + s = "SELECT username FROM all_users ORDER BY username" cursor = self._inspector_instance.bind.execute(s) return [ self._inspector_instance.dialect.normalize_name(row[0]) @@ -132,7 +132,7 @@ def get_table_names( if schema is None: schema = self._inspector_instance.dialect.default_schema_name - sql_str = "SELECT table_name FROM dba_tables WHERE " + sql_str = "SELECT table_name FROM all_tables WHERE " if self.exclude_tablespaces: tablespace_str = ", ".join([f"'{ts}'" for ts in self.exclude_tablespaces]) sql_str += ( diff --git a/metadata-ingestion/tests/integration/oracle/common.py b/metadata-ingestion/tests/integration/oracle/common.py index 24aba6933d970..ca11a29a936a6 100644 --- a/metadata-ingestion/tests/integration/oracle/common.py +++ b/metadata-ingestion/tests/integration/oracle/common.py @@ -15,7 +15,7 @@ class OracleSourceMockDataBase: """ MOCK_DATA = { - "SELECT username FROM dba_users ORDER BY username": (["schema1"], ["schema2"]), + "SELECT username FROM all_users ORDER BY username": (["schema1"], ["schema2"]), "schema1": (["test1"], ["test2"]), "schema2": (["test3"], ["test4"]), }