michaelsembwever commented on code in PR #4353:
URL: https://github.com/apache/cassandra/pull/4353#discussion_r2933555901
##########
src/java/org/apache/cassandra/index/sai/disk/v1/V1SSTableIndex.java:
##########
@@ -174,14 +175,28 @@ public List<KeyRangeIterator> search(Expression
expression,
return segmentIterators;
}
- @Override
- public KeyRangeIterator limitToTopKResults(QueryContext context,
List<PrimaryKey> primaryKeys, Expression expression) throws IOException
+ public List<CloseableIterator<PrimaryKeyWithScore>> orderBy(Expression
orderer, AbstractBounds<PartitionPosition> keyRange, QueryContext context)
throws IOException
+ {
+ // Return a list to allow the caller to merge the results from
multiple sstables into a single iterator.
+ List<CloseableIterator<PrimaryKeyWithScore>> iterators = new
ArrayList<>(segments.size());
+ for (Segment segment : segments)
+ {
+ if (segment.intersects(keyRange))
+ {
+ iterators.add(segment.orderBy(orderer, keyRange, context));
+ }
+ }
Review Comment:
entirely optional
```suggestion
for (Segment segment : segments)
if (segment.intersects(keyRange))
iterators.add(segment.orderBy(orderer, keyRange, context));
```
--
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]