Skip to content

feat: Experimental support for sinking to Iceberg#23011

Closed
coastalwhite wants to merge 1 commit intopola-rs:mainfrom
coastalwhite:feat/sink-iceberg
Closed

feat: Experimental support for sinking to Iceberg#23011
coastalwhite wants to merge 1 commit intopola-rs:mainfrom
coastalwhite:feat/sink-iceberg

Conversation

@coastalwhite
Copy link
Copy Markdown
Collaborator

@coastalwhite coastalwhite commented May 30, 2025

Warning

This is very experimental. Please back up your data before relying on this.

This is the first iteration of streaming sinking to Iceberg.

catalog = load_catalog(...)
table = catalog.load_table(...)

lf.sink_iceberg(table, mode='append')

lf.sink_iceberg(table, mode='overwrite')

This does not implement:

  • Iceberg sort orders
  • Upserting

ping @nameexhaustion

There are still a few things that need to happen to land this PR:

@github-actions github-actions Bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels May 30, 2025
@coastalwhite coastalwhite force-pushed the feat/sink-iceberg branch 2 times, most recently from b7931ee to bdc1170 Compare May 30, 2025 12:17
@ritchie46
Copy link
Copy Markdown
Member

I think we need a docs/rst entry.

Comment thread py-polars/polars/lazyframe/frame.py Outdated
@nameexhaustion
Copy link
Copy Markdown
Collaborator

I think we should also test collecting after serialization / pickling round-trip for sink_iceberg(lazy=True).

As a side question, where can we find the new metadata location after sinking? Is it already updated on the iceberg table object?

Comment thread py-polars/docs/source/reference/io.rst Outdated
@coastalwhite coastalwhite force-pushed the feat/sink-iceberg branch 3 times, most recently from 069b31d to dc00684 Compare June 2, 2025 13:16
> [!WARNING]:
> This is very experimental. Please back up your data before relying on this.

This is the first iteration of streaming sinking to Iceberg.

```python
catalog = load_catalog(...)
table = catalog.load_table(...)

lf.sink_iceberg(table, mode='append')

lf.sink_iceberg(table, mode='overwrite')
```
@coastalwhite
Copy link
Copy Markdown
Collaborator Author

This will be worked on further by @nameexhaustion.

Closing this PR as it will no longer receive updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add sink_iceberg

3 participants