JingsongLi commented on code in PR #9420:
URL: https://github.com/apache/paimon/pull/9420#discussion_r3863939735
##########
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:
We should not add a heavy scan in schema manager.
--
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]