You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dynamic_partition_overwrite by identity(s.x) deletes rows by top-level x #4196
Currently, dynamic_partition_overwrite builds its delete filter from find_field(source_id).name, which is x for s.x, so it deletes the rows whose top-level x matches and keeps the old rows of the partition it replaces. Without a top-level column of that name it raises ValueError.
importtempfileimportpyarrowaspafrompyiceberg.catalog.sqlimportSqlCatalogfrompyiceberg.partitioningimportPartitionField, PartitionSpecfrompyiceberg.schemaimportSchemafrompyiceberg.transformsimportIdentityTransformfrompyiceberg.typesimportLongType, NestedField, StructTypecat=SqlCatalog("c", uri="sqlite:///:memory:", warehouse=f"file://{tempfile.mkdtemp()}")
cat.create_namespace("ns")
schema=Schema(NestedField(1, "x", LongType()), NestedField(2, "s", StructType(NestedField(3, "x", LongType()))))
t=cat.create_table("ns.t", schema=schema, partition_spec=PartitionSpec(PartitionField(3, 1000, IdentityTransform(), "s_x")))
df=lambda*rs: pa.Table.from_pylist([{"x": x, "s": {"x": sx}} forx, sxinrs], schema=schema.as_arrow())
t.append(df((1, 5), (5, 1)))
t.dynamic_partition_overwrite(df((9, 5)))
print(sorted((r["x"], r["s"]["x"]) forrint.scan().to_arrow().to_pylist()))
# [(1, 5), (9, 5)], should be [(5, 1), (9, 5)]# rows are (x, s.x): partition s.x = 1 lost its row and s.x = 5 kept its old one
_determine_partitions uses find_column_name for the same field since #2204.
tested on pyiceberg 0.12.0 and main
Willingness to contribute
I can contribute a fix for this bug independently
I would be willing to contribute a fix for this bug with guidance from the Iceberg community
I cannot contribute a fix for this bug at this time
Thanks a lot for the clear report and the reproducible example (´。• ᵕ •。`) I'd like to take this one, and I've opened #4204 with a fix and a regression test based on your example. I'd be really grateful if you could take a look whenever you have a moment. No rush at all, and any feedback is very welcome! (๑•̀ㅂ•́)و✧
Looked at #4204. Switching to find_column_name with the same ValueError matches what _determine_partitions does for this field, and the new test is the repro from this issue, so the diff looks right to me.
Activity
dragonknightk commentedon Oct 30, 2026
Thanks a lot for the clear report and the reproducible example (´。• ᵕ •。`) I'd like to take this one, and I've opened #4204 with a fix and a regression test based on your example. I'd be really grateful if you could take a look whenever you have a moment. No rush at all, and any feedback is very welcome! (๑•̀ㅂ•́)و✧
RyanLin5967 commentedon Oct 31, 2026
Looked at #4204. Switching to
find_column_namewith the sameValueErrormatches what_determine_partitionsdoes for this field, and the new test is the repro from this issue, so the diff looks right to me.