Thanks, Matthias, for the feedback!

> Not sure if "bound" is the right term?
My understanding from your comment is that just the name "*bound*" is not
the right one, while having this query type makes sense.  Right? If *bound*
is a confusing word, we can simply change it to a better one. I do not have
a better idea at the moment. We can change it to "*whatever query type*
with untilTimestamp"? and change the corresponding method name from "
withWhateverWithTimestampBound" to "withWhateverWithUntilTimestamp"?

> Should we also add `withLowerTimeBound` and `withUpperTimeBound` (similar
to what `RangeQuery` has)?
In none of the range queries, we have a lower bound for time. If you look
at them, they have either both time bounds, no bounds (all-versions), or
just upper bound (UntilTimestamp as an input parameter). Do you think we
should add those types of queries as well? We can add them for both key and
range queries. I agree with you.

> Btw: I think we should not pass `long` for timestamps, but `Instance`
types.
Good point. Making the user convert the timestamp to a long does not make
sense.

> For time-range queries, do we iterate over the values in timestamp
ascending order?
That was my assumption, at least.
> If yes, the interface should specify it?
Mmmm. You mean having that in the method input parameters?
> Also, would it make sense to add reverse order
I think yes.

> Also, for time-range query, what are the exact bound for stuff we include?
I 'm not sure if I get what you mean. Your point is that we have the
following options and should choose one?!

   1. *(*asOfTimestamp, untilTimestamp*)*
   2. *(*asOfTimestamp, untilTimestamp*]*
   3. *[*asOfTimestamp, untilTimestamp*)*
   4. *[*asOfTimestamp, untilTimestamp*]*



> For key-range / time-range queries: do we return the result in `<k,ts>`
order or `<ts,k>` order? Also, what about reverse iterators?
I suggest having both. The user can specify that. About reverse iterators,
again, my idea is that it makes sense to have them.

> About ` ValueIterator` .........
Thanks. I got that and corrected the KIP.



On Wed, Jul 26, 2023 at 11:40 PM Matthias J. Sax <mj...@apache.org> wrote:

> Thanks for the KIP Alieh. Glad to see that we can add IQ to the new
> versioned stores!
>
>
>
> Couple of questions:
>
> > single-key lookup with timestamp (upper) bound
>
> Not sure if "bound" is the right term? In the end, it's a point lookup
> for a key plus timestamps, so it's an as-of timestamp (not a bound)? Of
> course, the returned record would most likely have a different (smaller)
> timestamp, but that's expected but does not make the passed in timestamp
> a "bound" IMHO?
>
> > single-key query with timestamp range
> > single-key all versions query
>
> Should we also add `withLowerTimeBound` and `withUpperTimeBound`
> (similar to what `RangeQuery` has)?
>
> Btw: I think we should not pass `long` for timestamps, but `Instance`
> types.
>
> For time-range queries, do we iterate over the values in timestamp
> ascending order? If yes, the interface should specify it? Also, would it
> make sense to add reverse order (also ok to exclude and only do if there
> is demand in a follow up KIP; if not, please add to "Rejected
> alternatives" section).
>
> Also, for time-range query, what are the exact bound for stuff we
> include? In the end, a value was a "valid range" (conceptually), so do
> we include a record if it's valid range overlaps the search time-range,
> or must it be fully included? Or would we only say, that the `validFrom`
> timestamp that is stored must be in the search range (what implies that
> the lower end would be a non-overlapping but "fully included" bound,
> while the upper end would be a overlapping bound).
>
> For key-range / time-range queries: do we return the result in `<k,ts>`
> order or `<ts,k>` order? Also, what about reverse iterators?
>
> About ` ValueIterator` -- think the JavaDocs have c&p error in it for
> `peekNextRecord` (also, should it be called `peekNextValue`? (Also some
> other JavaDocs seem to be incomplete and not describe all parameters?)
>
>
> Thanks.
>
>
>
> -Matthias
>
>
>
> On 7/26/23 7:24 AM, Alieh Saeedi wrote:
> > Hi all,
> >
> > I would like to propose a KIP to support IQv2 for versioned state stores.
> >
> >
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-960%3A+Support+interactive+queries+%28IQv2%29+for+versioned+state+stores
> >
> > Looking forward to your feedback!
> >
> > Cheers,
> > Alieh
> >
>

Reply via email to