From 4464df81ff065c12ab9efaa2333f8d51be059ade Mon Sep 17 00:00:00 2001 From: Ayush Shah Date: Wed, 23 Aug 2023 17:30:44 +0530 Subject: [PATCH] Add include views to profiler (#12974) --- ingestion/src/metadata/profiler/api/workflow.py | 12 ++++++++++-- .../databaseServiceProfilerPipeline.json | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/profiler/api/workflow.py b/ingestion/src/metadata/profiler/api/workflow.py index cd1a6a20585..27a7b17bc04 100644 --- a/ingestion/src/metadata/profiler/api/workflow.py +++ b/ingestion/src/metadata/profiler/api/workflow.py @@ -23,7 +23,7 @@ from pydantic import ValidationError from metadata.config.common import WorkflowExecutionError from metadata.generated.schema.entity.data.database import Database -from metadata.generated.schema.entity.data.table import Table +from metadata.generated.schema.entity.data.table import Table, TableType from metadata.generated.schema.entity.services.connections.database.datalakeConnection import ( DatalakeConnection, ) @@ -194,7 +194,15 @@ class ProfilerWorkflow(WorkflowStatusMixin): "Table pattern not allowed", ) continue - + if ( + table.tableType == TableType.View + and not self.source_config.includeViews + ): + self.source_status.filter( + table.fullyQualifiedName.__root__, + "View filtered out", + ) + continue yield table except Exception as exc: error = ( diff --git a/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/databaseServiceProfilerPipeline.json b/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/databaseServiceProfilerPipeline.json index ec1bf774c6b..c7d11822ad5 100644 --- a/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/databaseServiceProfilerPipeline.json +++ b/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/databaseServiceProfilerPipeline.json @@ -30,6 +30,11 @@ "description": "Regex to only fetch databases that matches the pattern.", "$ref": "../type/filterPattern.json#/definitions/filterPattern" }, + "includeViews": { + "description": "Optional configuration to turn off fetching metadata for views.", + "type": "boolean", + "default": true + }, "processPiiSensitive": { "description": "Optional configuration to automatically tag columns that might contain sensitive information", "type": "boolean",