Skip to content

Support scanning a specific branch of a table #1746

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

Open
malcolmbovey opened this issue Feb 28, 2025 · 3 comments
Open

Support scanning a specific branch of a table #1746

malcolmbovey opened this issue Feb 28, 2025 · 3 comments

Comments

@malcolmbovey
Copy link

malcolmbovey commented Feb 28, 2025

Feature Request / Improvement

As far as I can tell, PyIceberg does not directly support being able to scan a particular branch of an iceberg table. For example, there is no way to be able to run an equivalent of queries like

SELECT * FROM <namespace>.<table>.<branch>;

as documented in https://iceberg.apache.org/docs/1.8.0/branching/#schema-selection-with-branches-and-tags

I can see that PR #941 to add support to write to branches in Pyiceberg is well on its way to be being merged in, so this would be a useful complement.

Alternatively, perhaps I'm mistaken and there is already a way to do this, but it wasn't clear in the documentation

@kevinjqliu
Copy link
Contributor

I dont think we have support for reading directly from a branch name yet. On the read side, you can specify a specific snapshot_id,

snapshot_id: Optional[int] = None,

I think if you find the specific snapshot_id for the branch, you can use the scan API to read.

@malcolmbovey
Copy link
Author

Thanks, would you like me to draft a PR tp enable a branch parameter to be passed to table.scan ?

@Fokko
Copy link
Contributor

Fokko commented Mar 2, 2025

Hey @malcolmbovey I think that would be a great addition 👍

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

No branches or pull requests

3 participants