dramaticlly commented on code in PR #13631:
URL: https://github.com/apache/iceberg/pull/13631#discussion_r2229552505
##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -121,180 +121,143 @@ public TableOperations underlyingOps() {
return ops;
}
- private void checkLastOperationCommitted(String operation) {
+ protected <T extends PendingUpdate> T appendUpdates(T update) {
+ if (!(update instanceof ManageSnapshots)) {
Review Comment:
I use typed parameter mostly trying to help avoid casting as Russell
suggested in
https://github.com/apache/iceberg/pull/13631#discussion_r2226011296.
But I think the problem still exists even after I switched to
```java
protected SnapshotProducer appendUpdates(SnapshotProducer update) {
checkLastOperationCommitted(update.getClass().getSimpleName());
update.deleteWith(enqueueDelete);
update.reportWith(reporter);
updates.add(update);
return update;
}
protected SnapshotUpdate appendUpdates(SnapshotUpdate update) {
checkLastOperationCommitted(update.getClass().getSimpleName());
update.deleteWith(enqueueDelete);
updates.add(update);
return update;
}
```
as in override of new AppendFiles, the static binding still bind to
SnapshotUpdate method instead of SnapshotProducer. I suspect there's something
relate to the inheritance tree
```java
@Override
public AppendFiles newFastAppend() {
AppendFiles append = new FastAppend(tableName, transactionOps);
// static binding to SnapshotUpdate instead of SnapshotProducer
return (AppendFiles) appendUpdates(append);
}
```
--
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]