diff --git a/ingestion/src/metadata/ingestion/source/database/sql_column_handler.py b/ingestion/src/metadata/ingestion/source/database/sql_column_handler.py index 0f1ef012f9a..6fc98ff1859 100644 --- a/ingestion/src/metadata/ingestion/source/database/sql_column_handler.py +++ b/ingestion/src/metadata/ingestion/source/database/sql_column_handler.py @@ -94,6 +94,12 @@ class SqlColumnHandlerMixin: parsed_string["name"] = column["name"] else: col_type = ColumnTypeParser.get_column_type(column["type"]) + # For arrays, we'll get the item type if possible, or parse the string representation of the column + # if SQLAlchemy does not provide any further information + if col_type == "ARRAY" and getattr(column["type"], "item_type"): + arr_data_type = ColumnTypeParser.get_column_type( + column["type"].item_type + ) if col_type == "ARRAY" and re.match( r"(?:\w*)(?:\()(\w*)(?:.*)", str(column["type"]) ): diff --git a/ingestion/src/metadata/profiler/orm/converter/common.py b/ingestion/src/metadata/profiler/orm/converter/common.py index 2d1e41e13dc..4c2f1d0997a 100644 --- a/ingestion/src/metadata/profiler/orm/converter/common.py +++ b/ingestion/src/metadata/profiler/orm/converter/common.py @@ -76,7 +76,9 @@ class CommonMapTypes: """returns an ORM type""" if col.arrayDataType: - return self._TYPE_MAP.get(col.dataType)(item_type=col.arrayDataType) + return self._TYPE_MAP.get(col.dataType)( + item_type=self._TYPE_MAP.get(col.arrayDataType) + ) return self.return_custom_type(col, table_service_type) def return_custom_type(self, col: Column, _):