maedhroz commented on code in PR #4055: URL: https://github.com/apache/cassandra/pull/4055#discussion_r2033627371
########## src/java/org/apache/cassandra/index/sai/disk/v1/MemtableIndexWriter.java: ########## @@ -91,14 +91,16 @@ public void addRow(PrimaryKey key, Row row, long sstableRowId) // keys and row IDs in the flushing SSTable. This writer, therefore, does nothing in // response to the flushing of individual rows except for keeping index-specific statistics. boolean isStatic = indexTermType.columnMetadata().isStatic(); + boolean isPartitionKey = indexTermType.columnMetadata().isPartitionKey(); // 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) + // come before any non-static row.) The only exception to this is indexes on partition key elements. + if ((key.kind() == PrimaryKey.Kind.STATIC && (isStatic || isPartitionKey)) || key.kind() != PrimaryKey.Kind.STATIC && !isStatic) Review Comment: Indexes in partition key elements can have static row matches, so we need to do this to handle the case where there isn't actually any non-static row data in the partition. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org