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


##########
paimon-core/src/main/java/org/apache/paimon/globalindex/GlobalIndexBuilderUtils.java:
##########
@@ -24,18 +24,31 @@
 import org.apache.paimon.index.GlobalIndexMeta;
 import org.apache.paimon.index.IndexFileMeta;
 import org.apache.paimon.index.IndexPathFactory;
+import org.apache.paimon.manifest.ManifestEntry;
 import org.apache.paimon.options.Options;
+import org.apache.paimon.schema.SchemaManager;
 import org.apache.paimon.table.FileStoreTable;
 import org.apache.paimon.types.DataField;
 import org.apache.paimon.utils.Range;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Nullable;
+
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;

Review Comment:
   **Suggestion — add `isMultiColumn()` helper to `GlobalIndexMeta`**
   
   The sentinel check `indexFieldId == MULTI_COLUMN_INDEX_FIELD_ID` is now 
scattered across many modules (MergeIntoUpdateChecker, 
MergeIntoPaimonDataEvolutionTable x2, FullTextReadImpl, VectorReadImpl, 
GlobalIndexScanner, GlobalIndexBuilderUtils, etc.). This is fragile — new code 
that touches `indexFieldId()` can easily forget the guard and crash on -1.
   
   Consider adding a convenience method to `GlobalIndexMeta`:
   ```java
   public boolean isMultiColumn() {
       return indexFieldId == MULTI_COLUMN_INDEX_FIELD_ID;
   }
   ```
   Then all call sites replace `meta.indexFieldId() == 
MULTI_COLUMN_INDEX_FIELD_ID` with `meta.isMultiColumn()`, which is more 
readable and harder to miss.



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