rdblue commented on a change in pull request #3834:
URL: https://github.com/apache/iceberg/pull/3834#discussion_r790357536
##########
File path: core/src/main/java/org/apache/iceberg/io/BaseTaskWriter.java
##########
@@ -151,9 +146,14 @@ private void internalPosDelete(StructLike key) {
* @param row the given row to delete.
*/
public void delete(T row) throws IOException {
- internalPosDelete(structProjection.wrap(asStructLike(row)));
+ StructProjection key = structProjection.wrap(asStructLike(row));
+ PathOffset previous = insertedRowMap.get(key);
- eqDeleteWriter.write(row);
+ if (previous != null){
+ posDeleteWriter.delete(previous.path, previous.rowOffset, null);
+ } else {
+ eqDeleteWriter.write(row);
+ }
Review comment:
Overall the logic change in this function looks reasonable to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]