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)
Feature Request / Improvement
upsertcompares 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: