michaeljmarshall commented on code in PR #4196:
URL: https://github.com/apache/cassandra/pull/4196#discussion_r2138642065


##########
src/java/org/apache/cassandra/index/sai/plan/QueryController.java:
##########
@@ -395,15 +407,15 @@ private KeyRangeIterator getTopKRows(List<PrimaryKey> 
rawSourceKeys, RowFilter.E
     /**
      * Create row id iterator from different indexes' on-disk searcher of the 
same sstable
      */
-    private KeyRangeIterator createRowIdIterator(Pair<Expression, 
Collection<SSTableIndex>> indexExpression)
+    private KeyRangeIterator 
createRowIdIterator(QueryViewBuilder.QueryExpressionView indexExpression)
     {
-        List<KeyRangeIterator> subIterators = indexExpression.right
+        List<KeyRangeIterator> subIterators = indexExpression.sstableIndexes
                            .stream()
                            .map(index ->
                                 {
                                     try
                                     {
-                                        List<KeyRangeIterator> iterators = 
index.search(indexExpression.left, mergeRange, queryContext);
+                                        List<KeyRangeIterator> iterators = 
index.search(indexExpression.expression, mergeRange, queryContext);
                                         // concat the result from multiple 
segments for the same index
                                         return 
KeyRangeConcatIterator.builder(iterators.size()).add(iterators).build();

Review Comment:
   Note for reviewers: we could technically remove this `createRowIdIterator` 
and collapse the logic in the calling method to use a 
`IndexSearchResultIterator` now. I didn't do that here though because this 
logic uses `KeyRangeConcatIterator` to more efficiently join sstable index 
segments. Since that is an optimization, I didn't want to update the logic in 
`IndexSearchResultIterator` on this bug fix. (I'd propose that the real fix is 
to update `SSTableIndex#search`'s return type from `List<KeyRangeIterator>` to 
`KeyRangeIterator` and then the implementation can use the 
`KeyRangeConcatIterator`.)



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