From 35d8c2a25cd73ea132b5446ae06bd54b65f38aed Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Tue, 20 May 2025 11:06:29 +0530 Subject: [PATCH] Fix #20746: DB columns in Vertica (#21288) --- .../source/database/vertica/queries.py | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/vertica/queries.py b/ingestion/src/metadata/ingestion/source/database/vertica/queries.py index 9252d026b6a..6bd17cf0686 100644 --- a/ingestion/src/metadata/ingestion/source/database/vertica/queries.py +++ b/ingestion/src/metadata/ingestion/source/database/vertica/queries.py @@ -28,20 +28,6 @@ import textwrap # v_catalog.comments with v_catalog.columns. VERTICA_GET_COLUMNS = textwrap.dedent( """ - WITH column_projection as ( - SELECT - column_id, - proj.projection_name - FROM v_catalog.columns col, - v_catalog.projections proj - where lower(table_name) = '{table}' - AND {schema_condition} - AND proj.projection_id in ( - select - min(projection_id) - from v_catalog.projections sub_proj - where col.table_id=sub_proj.anchor_table_id - )) select column_name, data_type, @@ -50,12 +36,11 @@ VERTICA_GET_COLUMNS = textwrap.dedent( comment from v_catalog.columns col - LEFT JOIN column_projection proj ON proj.column_id = col.column_id - LEFT JOIN v_catalog.comments com ON com.object_type = 'COLUMN' - AND com.object_name = CONCAT( - CONCAT(proj.projection_name, '.'), - col.column_name - ) + LEFT JOIN v_catalog.comments cm + ON col.table_schema = cm.object_schema + AND col.table_name = cm.object_name + AND col.column_name = cm.child_object + AND cm.object_type = 'COLUMN' WHERE lower(table_name) = '{table}' AND {schema_condition}