mayya-sharipova commented on code in PR #16219:
URL: https://github.com/apache/lucene/pull/16219#discussion_r3401634463


##########
lucene/core/src/java/org/apache/lucene/index/IndexingChain.java:
##########
@@ -740,14 +742,34 @@ void processBatch(int baseDocID, ColumnBatch columnBatch) 
throws IOException {
       }
       docFields[columnIdx++] = pf;
 
-      if (pf.fieldGen == batchGen) {
+      if (pf.fieldGen != batchGen) {
+        // First column for this field name in this batch: start a fresh 
schema and aspect set, and
+        // collect the field once so its FieldInfo is initialized/validated 
after the loop.
+        pf.fieldGen = batchGen;
+        pf.columnAspects = 0;
+        pf.schema.reset(baseDocID);
+        fields[uniqueFieldCount++] = pf;
+      }
+
+      // Each indexing aspect must come from a single column for a given field 
name.
+      int columnAspects = ColumnValidation.aspectMask(fieldType);
+      int overlap = pf.columnAspects & columnAspects;
+      if (overlap != 0) {
         throw new IllegalArgumentException(
-            "ColumnBatch contains more than one column for field \""
+            "ColumnBatch has multiple columns for field \""
                 + fieldName
-                + "\"; multi-valued fields must use a single column with a 
sparse cursor");
+                + "\" claiming the same indexing aspect "
+                + ColumnValidation.aspectNames(overlap)
+                + "; each aspect must come from a single column.");

Review Comment:
   nit: "must come  from **at most** one column"



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

Reply via email to