Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor Author

@HonahX HonahX Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is for the optional StorageDescriptor, I think it should not block the table creation even when encountering unknown primitive types

return GLUE_PRIMITIVE_TYPES[primitive_type]


Expand Down