hanyuzheng7 commented on code in PR #14821: URL: https://github.com/apache/kafka/pull/14821#discussion_r1402442067
########## streams/src/main/java/org/apache/kafka/streams/query/StateQueryResult.java: ########## @@ -77,6 +79,12 @@ public QueryResult<R> getOnlyPartitionResult() { "The query did not return exactly one partition result: " + partitionResults ); } else { + if (nonempty.isEmpty() && partitionResults.size() != 0 && partitionResults.get(0).isFailure()) { + FailureReason failureReason = partitionResults.get(0).getFailureReason(); + if (failureReason.equals(FailureReason.UNKNOWN_QUERY_TYPE)) { + return QueryResult.forFailure(FailureReason.UNKNOWN_QUERY_TYPE, "unknown query type"); + } Review Comment: I think we can use a for loop to count failure reason, if all of them are unknown query type, we can return `QueryResult.forFailure(FailureReason.UNKNOWN_QUERY_TYPE, "unknown query type")` in the end. -- 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