zhoulii commented on code in PR #9420:
URL: https://github.com/apache/paimon/pull/9420#discussion_r3868189289
##########
paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java:
##########
@@ -1035,6 +1069,75 @@ private static void
assertNotUpdatingPrimaryKeyIndexColumn(
}
}
+ private void assertNoGlobalIndexReferences(
+ SnapshotManager snapshotManager, TableSchema schema, Set<Integer>
affectedFieldIds) {
+ if (affectedFieldIds.isEmpty()) {
+ return;
+ }
+
+ Snapshot snapshot = snapshotManager.latestSnapshot();
+ if (snapshot == null || snapshot.indexManifest() == null) {
+ return;
+ }
+
+ Options dynamicOptions = new Options();
+ dynamicOptions.set(CoreOptions.BRANCH, branch);
+ FileStoreTable table =
+ FileStoreTableFactory.createWithoutFallbackBranch(
+ fileIO, tableRoot, schema, dynamicOptions,
CatalogEnvironment.empty());
+ List<IndexManifestEntry> references =
+ table.store()
+ .newIndexFileHandler()
+ .scan(
Review Comment:
Thanks for pointing this out. You're right that SchemaManager should not
perform a potentially heavy index manifest scan. I'll close this PR.
--
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]