leaves12138 commented on code in PR #8549:
URL: https://github.com/apache/paimon/pull/8549#discussion_r3563917643


##########
paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java:
##########
@@ -894,6 +909,26 @@ private static Map<String, String> 
applyRenameColumnsToOptions(
             }
         }
 
+        // A vector field owns both pk-vector options and algorithm-specific 
options below its
+        // fields.<column>. namespace. Move the complete namespace after the 
specialized option
+        // rewrites above so keys handled by case 3 are not processed twice.
+        for (RenameColumn rename : renameColumns) {
+            String fieldName = rename.fieldNames()[0];
+            if (!vectorIndexColumns.contains(fieldName)) {
+                continue;
+            }
+            String oldPrefix = FIELDS_PREFIX + "." + fieldName + ".";
+            String newPrefix = FIELDS_PREFIX + "." + rename.newName() + ".";
+            for (String key : options.keySet()) {
+                if (key.startsWith(oldPrefix)) {
+                    String value = newOptions.remove(key);
+                    if (value != null) {
+                        newOptions.put(newPrefix + 
key.substring(oldPrefix.length()), value);

Review Comment:
   This moves top-level table-option keys, but it leaves field-qualified keys 
embedded inside `fields.<column>.pk-vector.index.options` unchanged. That JSON 
form is explicitly supported by 
`PrimaryKeyVectorIndexOptionsTest.testResolvesShortAndQualifiedAlgorithmOptions`
 (for example, `"fields.embedding.hnsw.m"`). I reproduced this by adding such 
an entry to the new `SchemaManagerTest`: the rename succeeds, but the final 
definition-ID equality fails because the resolved option remains under 
`fields.embedding.*` instead of `fields.renamed_embedding.*`. Please rewrite 
qualified keys inside the JSON during rename, or disallow them in the resolver; 
otherwise the rename still changes definition identity and passes stale 
field-scoped options to the indexer.



-- 
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]

Reply via email to