Skip to content

Commit 40ab60a

Browse files
authored
glue: Allow TimestampzType (#366)
1 parent 9e4ed29 commit 40ab60a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyiceberg/catalog/glue.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
StringType,
8686
StructType,
8787
TimestampType,
88+
TimestamptzType,
8889
TimeType,
8990
UUIDType,
9091
)
@@ -125,6 +126,7 @@ def _construct_parameters(
125126
StringType: "string",
126127
UUIDType: "string",
127128
TimestampType: "timestamp",
129+
TimestamptzType: "timestamp",
128130
FixedType: "binary",
129131
BinaryType: "binary",
130132
}
@@ -150,7 +152,7 @@ def primitive(self, primitive: PrimitiveType) -> str:
150152
if isinstance(primitive, DecimalType):
151153
return f"decimal({primitive.precision},{primitive.scale})"
152154
if (primitive_type := type(primitive)) not in GLUE_PRIMITIVE_TYPES:
153-
raise ValueError(f"Unknown primitive type: {primitive}")
155+
return str(primitive_type.root)
154156
return GLUE_PRIMITIVE_TYPES[primitive_type]
155157

156158

0 commit comments

Comments
 (0)