From 131e5f5767830f1d2c27455f6a85a3756e628e08 Mon Sep 17 00:00:00 2001 From: Onkar Ravgan Date: Fri, 2 Feb 2024 14:34:43 +0530 Subject: [PATCH] Modified snowflake view def query (#14994) --- .../metadata/ingestion/source/database/snowflake/utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/snowflake/utils.py b/ingestion/src/metadata/ingestion/source/database/snowflake/utils.py index 0876d44c269..e9f2be41869 100644 --- a/ingestion/src/metadata/ingestion/source/database/snowflake/utils.py +++ b/ingestion/src/metadata/ingestion/source/database/snowflake/utils.py @@ -120,13 +120,10 @@ def get_view_definition( # pylint: disable=unused-argument schema = schema or self.default_schema_name if schema: cursor = connection.execute( - "SHOW /* sqlalchemy:get_view_definition */ VIEWS " - f"LIKE '{view_name}' IN {schema}" + f"SELECT GET_DDL('VIEW','{schema}.{view_name}') AS \"text\"" ) else: - cursor = connection.execute( - "SHOW /* sqlalchemy:get_view_definition */ VIEWS " f"LIKE '{view_name}'" - ) + cursor = connection.execute(f"SELECT GET_DDL('VIEW','{view_name}') AS \"text\"") n2i = self.__class__._map_name_to_idx(cursor) # pylint: disable=protected-access try: ret = cursor.fetchone()