From ecb4baa78706dd38adc2d2cff3be10868a3735f7 Mon Sep 17 00:00:00 2001 From: Akash Verma Date: Fri, 10 Jan 2025 14:12:29 +0530 Subject: [PATCH] added condition for datatype=array without type consistency --- .../ingestion/source/database/column_type_parser.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ingestion/src/metadata/ingestion/source/database/column_type_parser.py b/ingestion/src/metadata/ingestion/source/database/column_type_parser.py index ab6f096a3dfd..5f535e8ea815 100644 --- a/ingestion/src/metadata/ingestion/source/database/column_type_parser.py +++ b/ingestion/src/metadata/ingestion/source/database/column_type_parser.py @@ -338,9 +338,10 @@ def get_source_type_contains_brackets(column_type: Any) -> str: ) @staticmethod - def _parse_datatype_string( + def _parse_datatype_string( # pylint: disable=too-many-return-statements data_type: str, **kwargs: Any # pylint: disable=unused-argument ) -> Union[object, Dict[str, object]]: + # pylint: disable=too-many-branches data_type = data_type.lower().strip() data_type = data_type.replace(" ", "") if data_type.startswith("array<"): @@ -384,6 +385,14 @@ def _parse_datatype_string( return ColumnTypeParser._parse_struct_fields_string(data_type[7:-1]) if ":" in data_type: return ColumnTypeParser._parse_struct_fields_string(data_type) + if data_type == "array": + data_type_string = { + "dataType": "ARRAY", + "arrayDataType": DataType.UNKNOWN, + "dataTypeDisplay": data_type, + } + return data_type_string + return ColumnTypeParser._parse_primitive_datatype_string(data_type) @staticmethod