Skip to content
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

Add spec_id back to data file #63

Merged
merged 5 commits into from
Oct 15, 2023
Merged

Conversation

puchengy
Copy link
Contributor

Spec id was removed in https://github.com/apache/iceberg-python/pull/40/files to wait for the decision of apache/iceberg#8730. This PR adds it back and is needed to unblock issue #46

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

This is a great start, but I think we need to inherit the spec from the manifest.

I think we can generalize the _inherit_sequence_number by renaming it to something like _inherit_from_manifest, and add a line to copy the spec-id from the manifest:

entry.data_file.spec_id = manifest.partition_spec_id

@@ -182,6 +182,7 @@ def __repr__(self) -> str:
doc="Splittable offsets",
),
NestedField(field_id=140, name="sort_order_id", field_type=IntegerType(), required=False, doc="Sort order ID"),
NestedField(field_id=141, name="spec_id", field_type=IntegerType(), required=False, doc="Partition spec ID"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to add the fields here since the spec_id isn't read/written.

@Fokko Fokko added this to the PyIceberg 0.6.0 release milestone Oct 13, 2023
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thank you @puchengy for fixing this 🙌

@Fokko
Copy link
Contributor

Fokko commented Oct 13, 2023

@puchengy can you fix the CI? We need to make this part of 0.5.1 since the spec_id was there before (as you pointed out on Slack :)

@puchengy
Copy link
Contributor Author

@Fokko Will do that.

@Fokko
Copy link
Contributor

Fokko commented Oct 13, 2023

@puchengy

make install && make lint should fix it. It also looks like the integration test is failing because FastAvro is missing the spec_id (and this is correct because it isn't written, the test should be updated).

@puchengy
Copy link
Contributor Author

puchengy commented Oct 13, 2023

@Fokko thanks I will address that today or tomorrow. If this becomes a blocker of the release and we need get it done quick, feel free to take it over.

@Fokko
Copy link
Contributor

Fokko commented Oct 13, 2023

@puchengy let me give it a try

@Fokko
Copy link
Contributor

Fokko commented Oct 13, 2023

@puchengy I think this fixes it: puchengy#1

@puchengy puchengy changed the title Add spec_id back to data file Add spec_id back to data file and also make data file inherit from manifest partition spec id Oct 13, 2023
@puchengy
Copy link
Contributor Author

@Fokko Thanks, adopted your suggestion and tried a local integration test and it passed.

@Fokko
Copy link
Contributor

Fokko commented Oct 13, 2023

Thanks!

It looks like some changes on the request side broke the CI: #69

@Fokko Fokko changed the title Add spec_id back to data file and also make data file inherit from manifest partition spec id Add spec_id back to data file Oct 15, 2023
@Fokko Fokko merged commit d022707 into apache:main Oct 15, 2023
6 checks passed
@Fokko
Copy link
Contributor

Fokko commented Oct 15, 2023

This is great, thanks @puchengy for fixing this 👍

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants