vpapavas commented on a change in pull request #11598:
URL: https://github.com/apache/kafka/pull/11598#discussion_r768481150



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/state/internals/InMemoryKeyValueStore.java
##########
@@ -92,11 +93,29 @@ Position getPosition() {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <R> QueryResult<R> query(
         final Query<R> query,
         final PositionBound positionBound,
         final boolean collectExecutionInfo) {
 
+        if (query instanceof RangeQuery) {
+            final RangeQuery<Bytes, byte[]> typedQuery = (RangeQuery<Bytes, 
byte[]>) query;
+            final KeyValueIterator<Bytes, byte[]> keyValueIterator;
+            if (typedQuery.getLowerBound().isPresent() && 
typedQuery.getUpperBound().isPresent()) {
+                keyValueIterator = 
this.range(typedQuery.getLowerBound().get(), typedQuery.getUpperBound().get());
+            } else if (typedQuery.getLowerBound().isPresent()) {
+                keyValueIterator = 
this.range(typedQuery.getLowerBound().get(), null);
+            } else if (typedQuery.getUpperBound().isPresent()) {
+                keyValueIterator = this.range(null, 
typedQuery.getUpperBound().get());
+            } else {
+                keyValueIterator = this.range(null, null);
+            }

Review comment:
       Oh jeez /facepalm. Yes!!!!




-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to