rdblue commented on code in PR #7880:
URL: https://github.com/apache/iceberg/pull/7880#discussion_r1315205343
##########
core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java:
##########
@@ -337,4 +394,67 @@ protected String tableName() {
return tableIdentifier.toString();
}
}
+
+ private class InMemoryViewOperations extends BaseViewOperations {
+ private final FileIO fileIO;
+ private final TableIdentifier identifier;
+
+ InMemoryViewOperations(FileIO fileIO, TableIdentifier identifier) {
+ this.fileIO = fileIO;
+ this.identifier = identifier;
+ }
+
+ @Override
+ public void doRefresh() {
+ String latestLocation = views.get(identifier);
+ if (latestLocation == null) {
+ disableRefresh();
+ } else {
+ refreshFromMetadataLocation(latestLocation);
+ }
+ }
+
+ @Override
+ public void doCommit(ViewMetadata base, ViewMetadata metadata) {
+ String newLocation = writeNewMetadata(metadata, currentVersion() + 1);
+ String oldLocation = base == null ? null : currentMetadataLocation();
Review Comment:
This is incorrect because there is no guarantee that `base` and
`currentMetadataLocation` match. `ViewMetadata` needs to carry the location it
was loaded from so it can be used here.
--
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]