Skip to content

Commit 322ad04

Browse files
ashrielbrianBrian Tang
and
Brian Tang
authored
Maps large_list to array (#3086)
Co-authored-by: Brian Tang <brian.tang@paynet.my>
1 parent 9c4b340 commit 322ad04

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

awswrangler/_data_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def pyarrow2athena( # noqa: PLR0911,PLR0912
5151
return pyarrow2athena(dtype=dtype.value_type, ignore_null=ignore_null)
5252
if pa.types.is_decimal(dtype):
5353
return f"decimal({dtype.precision},{dtype.scale})"
54-
if pa.types.is_list(dtype):
54+
if pa.types.is_list(dtype) or pa.types.is_large_list(dtype):
5555
return f"array<{pyarrow2athena(dtype=dtype.value_type, ignore_null=ignore_null)}>"
5656
if pa.types.is_struct(dtype):
5757
return (
@@ -100,7 +100,7 @@ def pyarrow2redshift( # noqa: PLR0911,PLR0912
100100
return f"DECIMAL({dtype.precision},{dtype.scale})"
101101
if pa.types.is_dictionary(dtype):
102102
return pyarrow2redshift(dtype=dtype.value_type, string_type=string_type)
103-
if pa.types.is_list(dtype) or pa.types.is_struct(dtype) or pa.types.is_map(dtype):
103+
if pa.types.is_list(dtype) or pa.types.is_struct(dtype) or pa.types.is_map(dtype) or pa.types.is_large_list(dtype):
104104
return "SUPER"
105105
raise exceptions.UnsupportedType(f"Unsupported Redshift type: {dtype}")
106106

@@ -213,7 +213,7 @@ def pyarrow2postgresql( # noqa: PLR0911
213213
return pyarrow2postgresql(dtype=dtype.value_type, string_type=string_type)
214214
if pa.types.is_binary(dtype):
215215
return "BYTEA"
216-
if pa.types.is_list(dtype):
216+
if pa.types.is_list(dtype) or pa.types.is_large_list(dtype):
217217
return pyarrow2postgresql(dtype=dtype.value_type, string_type=string_type) + "[]"
218218
raise exceptions.UnsupportedType(f"Unsupported PostgreSQL type: {dtype}")
219219

0 commit comments

Comments
 (0)