Skip to content

Commit 2de947a

Browse files
author
gmweaver
committed
fix checking physical type for Decimal to handle INT32/INT64 storage based on size
1 parent e5e7453 commit 2de947a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,6 +2089,9 @@ def __init__(self, iceberg_type: PrimitiveType, physical_type_string: str, trunc
20892089
physical_type_string == "FLOAT" and expected_physical_type == "DOUBLE"
20902090
):
20912091
pass
2092+
# Allow DECIMAL to be stored as FIXED_LEN_BYTE_ARRAY
2093+
if (physical_type_string == "FIXED_LEN_BYTE_ARRAY" and expected_physical_type in ("INT32", "INT64")):
2094+
pass
20922095
else:
20932096
raise ValueError(
20942097
f"Unexpected physical type {physical_type_string} for {iceberg_type}, expected {expected_physical_type}"

0 commit comments

Comments
 (0)