maedhroz commented on code in PR #2935:
URL: https://github.com/apache/cassandra/pull/2935#discussion_r1496370359


##########
src/java/org/apache/cassandra/index/sai/disk/v1/MemtableIndexWriter.java:
##########
@@ -83,13 +89,31 @@ public void addRow(PrimaryKey key, Row row, long 
sstableRowId)
     {
         // Memtable indexes are flushed directly to disk with the aid of a 
mapping between primary
         // keys and row IDs in the flushing SSTable. This writer, therefore, 
does nothing in
-        // response to the flushing of individual rows.
+        // response to the flushing of individual rows except for keeping 
index-specific statistics.
+        boolean isStatic = indexTermType.columnMetadata().isStatic();
+
+        // Indexes on static columns should only track static rows, and 
indexes on non-static columns 
+        // should only track non-static rows. (Within a partition, the row ID 
for a static row will always
+        // come before any non-static row.) 
+        if (key.kind() == PrimaryKey.Kind.STATIC && isStatic || key.kind() != 
PrimaryKey.Kind.STATIC && !isStatic)
+        {
+            if (minKey == null)
+                minKey = key;
+            maxKey = key;

Review Comment:
   Yeah, we should make that explicit in the `PCIW` method doc.



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