Lucia Cerchie created KAFKA-15126:
-------------------------------------

             Summary: Change range queries to accept null lower and upper bounds
                 Key: KAFKA-15126
                 URL: https://issues.apache.org/jira/browse/KAFKA-15126
             Project: Kafka
          Issue Type: Improvement
          Components: streams
            Reporter: Lucia Cerchie
            Assignee: Lucia Cerchie


{color:#1d1c1d}When web client requests come in with query params, it's common 
for those params to be null. We want developers to just be able to pass in the 
upper/lower bounds if they want instead of implementing their own logic to 
avoid getting the whole range (which will happen if they leave the params 
null). {color}

{color:#1d1c1d}An example of the logic they can avoid using after this KIP is 
implemented is below:{color}
{code:java}
private RangeQuery<String, ValueAndTimestamp<StockTransactionAggregation>> 
createRangeQuery(String lower, String upper) {
        if (isBlank(lower) && isBlank(upper)) {
            return RangeQuery.withNoBounds();
        } else if (!isBlank(lower) && isBlank(upper)) {
            return RangeQuery.withLowerBound(lower);
        } else if (isBlank(lower) && !isBlank(upper)) {
            return RangeQuery.withUpperBound(upper);
        } else {
            return RangeQuery.withRange(lower, upper);
        }
    } {code}
 
| |



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to