hanyuzheng7 commented on code in PR #14570: URL: https://github.com/apache/kafka/pull/14570#discussion_r1396791842
########## streams/src/main/java/org/apache/kafka/streams/state/internals/KeyValueToTimestampedKeyValueByteStoreAdapter.java: ########## @@ -127,9 +136,25 @@ public <R> QueryResult<R> query( final QueryConfig config) { + final long start = config.isCollectExecutionInfo() ? System.nanoTime() : -1L; - final QueryResult<R> result = store.query(query, positionBound, config); + QueryResult<R> result = store.query(query, positionBound, config); + + if (result.isSuccess()) { + if (query instanceof KeyQuery || query instanceof TimestampedKeyQuery) { + final byte[] plainValue = (byte[]) result.getResult(); + final byte[] valueWithTimestamp = convertToTimestampedFormat(plainValue); + result = (QueryResult<R>) InternalQueryResultUtil.copyAndSubstituteDeserializedResult(result, valueWithTimestamp); + } else if (query instanceof RangeQuery || query instanceof TimestampedRangeQuery) { + final KeyValueToTimestampedKeyValueAdapterIterator wrappedRocksDBRangeIterator = new KeyValueToTimestampedKeyValueAdapterIterator((RocksDbIterator) result.getResult()); + result = (QueryResult<R>) InternalQueryResultUtil.copyAndSubstituteDeserializedResult(result, wrappedRocksDBRangeIterator); + } else { + throw new StreamsException("unsupported query type"); Review Comment: ok -- 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