-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write UUID fail on _check_schema_compatible #855
Comments
hey @kevinjqliu |
I see, I also verified that Heres an example to repro: def test_schema_uuid() -> None:
import polars as pl
iceberg_schema = Schema(
NestedField(1, "id", UUIDType(), required=True),
)
id_to_write = uuid.uuid4()
df = pl.DataFrame({}).with_columns([pl.lit(id_to_write.bytes).alias("id")])
df = df.to_arrow()
df = df.cast(target_schema=iceberg_schema.as_arrow())
_check_schema_compatible(iceberg_schema, df.schema) Looks like @Fokko opened an issue regarding UUID for arrow @Fokko can you chime in here on writing UUID data type? |
Thanks for pinging me here. So there is some progress on the Arrow side. There has been a vote to adopt the UUID type, and it has been added to the format. Thanks for the example code @kevinjqliu: And I would say that they are equivalent. So if we know that the field in the Iceberg table is a UUID, just writing a |
Hi @raphaelauv thank you for raising this issue. #921 should fix this issue. Would you like to give it a try? I've added a test including UUIDType to demonstrate that the fix will work |
Fixed in #921 Specifically, tested here |
Apache Iceberg version
main (development)
Please describe the bug 🐞
I can't write a UUID in an iceberg table
but if I comment the call to
_check_schema_compatible
then it write to the tableiceberg-python/pyiceberg/table/__init__.py
Line 485 in a6cd0cf
and I can read the data with trino
The text was updated successfully, but these errors were encountered: