Skip to content

Commit

Permalink
added condition for datatype=array without type consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Akash Verma authored and Akash Verma committed Jan 10, 2025
1 parent 63aa484 commit ecb4baa
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<"):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ecb4baa

Please sign in to comment.