Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Upsert gets slow on tables with many columns

Open
#3,860 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start with pyiceberg.table.upsert_util.get_rows_to_update and run the provided PyArrow reproduction with 20,000 rows and 200 columns. Compare the current behavior on unchanged tables and trace where matched rows are compared; done means the no-change upsert comparison avoids the reported column-dependent slowdown while preserving the expected rows to update.

Written by the indexing model from the issue text.

Description

Feature Request / Improvement

upsert compares the matched rows one cell at a time, so it gets slower with every extra column, not just with every extra row.

On a table with 200 columns, comparing 20k matched rows takes around 20 seconds on my machine, before anything is written.

To reproduce:

import time
import pyarrow as pa
from pyiceberg.table.upsert_util import get_rows_to_update

rows, cols = 20_000, 200
table = pa.table({"pk": pa.array(range(rows)), **{f"c{i}": pa.array([float(i)] * rows) for i in range(cols)}})

start = time.monotonic()
get_rows_to_update(table, table, ["pk"])  # nothing has changed
print(time.monotonic() - start)
Dominant language
Python
Stars
1.1k
Forks
589
Avg merge
2d 2h
Merged PRs (30d)
70

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg-python

All issues in apache/iceberg-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.