Repository navigation
fix: arrow schema to schema supports uuids - #2930
Conversation
30d1bc2 to
2fd4148
Compare
mbutrovich
left a comment
There was a problem hiding this comment.
First pass, thanks for looking at this @JosephLenton!
2fd4148 to
dc6f224
Compare
|
Thank you for the review @mbutrovich . You should find all of your comments addressed. I made all of the changes you suggested, and brought in UUID support on When you have time if I could get another review please, that would be grand! |
dc6f224 to
445db4a
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions. |
|
I am still waiting on a review for this. |
mbutrovich
left a comment
There was a problem hiding this comment.
Thanks for the updates @JosephLenton, and sorry for the wait. The storage check and the reverse-direction tagging both look good. The comments below are about enabling the matching parquet feature so the new tag reaches the files we write, plus a stale doc comment and a few test gaps.
| arrow-cast = { workspace = true } | ||
| arrow-ord = { workspace = true } | ||
| arrow-schema = { workspace = true } | ||
| arrow-schema = { workspace = true, features = ["canonical_extension_types"] } |
There was a problem hiding this comment.
Now that schema_to_arrow_schema tags UUID fields with arrow.uuid, should parquet get its arrow_canonical_extension_types feature too (line 69)? The arrow-schema feature enabled here doesn't turn on the parquet one, and parquet's UUID mapping is behind its own cfg(feature = "arrow_canonical_extension_types").
I wrote a UUID column through ParquetWriter at this commit and inspected the file. The Parquet column has no logical type, but the spec requires fixed_len_byte_array[16] with the UUID logical type (spec). Reads also disagree depending on who wrote the file. Our files come back tagged arrow.uuid only because arrow-rs embeds the ARROW:schema footer entry. A file without that entry (Java, Spark, PyIceberg) comes back as a bare FixedSizeBinary(16), even though schema_to_arrow_schema for the same table now says arrow.uuid.
With features = ["async", "encryption", "arrow_canonical_extension_types"] on parquet, the writer emits the UUID logical type and all three cases read back tagged. cargo test -p iceberg --lib still passes with that change (1580 passed). Could you add it here, with a writer test that asserts the logical type in the Parquet schema?
There was a problem hiding this comment.
I think I have this done. I broke out all my changes into their own commits for ease of review. The change for this is done here: 58cb38e
I did also get Claude to help me understand this and write it. Please do raise if you feel my work here is wrong.
|
It's all good on the delays @mbutrovich . Cheers for the re-review. I will look through it and rectify those points. |
445db4a to
58cb38e
Compare
|
Hey @mbutrovich , can I have a re-review please. You should find I have rebased my PR off of main, and addressed all of your comments. |
CTTY
left a comment
There was a problem hiding this comment.
LGTM! thanks for fixing it! Could you fix the CI before we merging it please?
58cb38e to
8aa6bc3
Compare
|
Cheers @CTTY ! I have rebased off I don't have the ability to hit merge. I will need someone to do that for me. |
Which issue does this PR close?
arrow_schema_to_schemaandarrow_schema_to_schema_auto_assign_ids.ARROW:extension:metadata=arrow.uuid, then the field is converted to an Iceberg UUID type.arrow_schema_to_schemafails to convert Arrow fields with UUID extension to Iceberg UUID #2929What changes are included in this PR?
variant.ToArrowSchemaConverteras well for converting from iceberg to arrow.Are these changes tested?
arrow_schema_to_schema_auto_assign_idstest.AI Disclosure
AI was used to:
test_arrow_schema_to_schema_with_field_id,test_parquet_writer_uuid_logical_type.I built a failing test first and reviewed it's code to ensure it's output worked.
The
test_arrow_schema_to_schema_should_convert_uuidstest, commit message, and the bug report, were all written without any AI at all.