From 2daa06a58fc9f684094e60e0133d69022c147d24 Mon Sep 17 00:00:00 2001 From: Tamas Nemeth Date: Fri, 14 Jan 2022 21:23:57 +0100 Subject: [PATCH] fix(ingest): redshift - mapping for spectrum external array types (#3890) --- .../src/datahub/ingestion/source/sql/redshift.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/redshift.py b/metadata-ingestion/src/datahub/ingestion/source/sql/redshift.py index f48dc8fcda..0d88132c36 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/redshift.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/redshift.py @@ -273,6 +273,7 @@ def _get_schema_column_info(self, connection, schema=None, **kw): CASE WHEN external_type = 'int' THEN 'integer' ELSE + regexp_replace( replace( replace( replace( @@ -283,7 +284,8 @@ def _get_schema_column_info(self, connection, schema=None, **kw): 'string', 'character varying'), 'char(', 'character('), 'float', 'real'), - 'double', 'float') + 'double', 'float'), + '^array<(.*)>$', '$1[]', 1, 'p') END AS "type", null as "distkey", 0 as "sortkey", @@ -294,6 +296,7 @@ def _get_schema_column_info(self, connection, schema=None, **kw): CASE WHEN external_type = 'int' THEN 'integer' ELSE + regexp_replace( replace( replace( replace( @@ -304,7 +307,8 @@ def _get_schema_column_info(self, connection, schema=None, **kw): 'string', 'character varying'), 'char(', 'character('), 'float', 'real'), - 'double', 'float') + 'double', 'float'), + '^array<(.*)>$', '$1[]', 1, 'p') END AS "format_type", null as "default", null as "schema_oid",