Skip to content

Commit

Permalink
handle TimestampzType
Browse files Browse the repository at this point in the history
  • Loading branch information
HonahX committed Feb 5, 2024
1 parent a3d529b commit ba833a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyiceberg/catalog/glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
StringType,
StructType,
TimestampType,
TimestamptzType,
TimeType,
UUIDType,
)
Expand Down Expand Up @@ -125,6 +126,7 @@ def _construct_parameters(
StringType: "string",
UUIDType: "string",
TimestampType: "timestamp",
TimestamptzType: "timestamp",
FixedType: "binary",
BinaryType: "binary",
}
Expand All @@ -150,7 +152,7 @@ def primitive(self, primitive: PrimitiveType) -> str:
if isinstance(primitive, DecimalType):
return f"decimal({primitive.precision},{primitive.scale})"
if (primitive_type := type(primitive)) not in GLUE_PRIMITIVE_TYPES:
raise ValueError(f"Unknown primitive type: {primitive}")
return str(primitive_type.root)
return GLUE_PRIMITIVE_TYPES[primitive_type]


Expand Down

0 comments on commit ba833a9

Please sign in to comment.