Hi, Hao, For TimestampedKeyQuery, it only returns the value of the key, and the value should be ValueAndTimestamp<V>. If you want to get an iterator of `ValueAndTimestamp<V>`, you can use TimestampedRangeQuery.
Sincerely, Hanyu On Mon, Oct 30, 2023 at 1:42 PM Hanyu (Peter) Zheng <pzh...@confluent.io> wrote: > Hi, Matthias, > Now, if we use TimestampedKeyQuery to query kv-store, it will throw a > exception, > the exception like this: > java.lang.IllegalArgumentException: Cannot get result for failed query. > > Sincerely, > Hanyu > > On Thu, Oct 26, 2023 at 3:45 PM Hao Li <h...@confluent.io.invalid> wrote: > >> Thanks for the KIP Hanyu! One question: why not return an iterator of >> `ValueAndTimestamp<V>` for `TimestampedKeyQuery`? I suppose for a >> ts-kv-store, there could be multiple timestamps associated with the same >> key? >> >> Hao >> >> On Thu, Oct 26, 2023 at 10:23 AM Matthias J. Sax <mj...@apache.org> >> wrote: >> >> > Would we really get a ClassCastException? >> > >> > From my understanding, the store would reject the query as unsupported >> > and thus the returned `QueryResult` object would have it's internal flag >> > set to indicate the failure, but no exception would be thrown directly? >> > >> > (Of course, there might be an exception thrown to the user if they don't >> > check `isSuccess()` flag but call `getResult()` directly.) >> > >> > >> > -Matthias >> > >> > On 10/25/23 8:55 AM, Hanyu (Peter) Zheng wrote: >> > > Hi, Bill, >> > > Thank you for your reply. Yes, now, if a user executes a timestamped >> > query >> > > against a non-timestamped store, It will throw ClassCastException. >> > > If a user uses KeyQuery to query kv-store or ts-kv-store, it always >> > return >> > > V. If a user uses TimestampedKeyQuery to query kv-store, it will >> throw a >> > > exception, so TimestampedKeyQuery query can only query ts-kv-store and >> > > return ValueAndTimestamp object in the end. >> > > >> > > Sincerely, >> > > Hanyu >> > > >> > > On Wed, Oct 25, 2023 at 8:51 AM Hanyu (Peter) Zheng < >> pzh...@confluent.io >> > > >> > > wrote: >> > > >> > >> Thank you Lucas, >> > >> >> > >> I will fix the capitalization. >> > >> When a user executes a timestamped query against a non-timestamped >> > store, >> > >> It will throw ClassCastException. >> > >> >> > >> Sincerely, >> > >> Hanyu >> > >> >> > >> On Tue, Oct 24, 2023 at 1:36 AM Lucas Brutschy >> > >> <lbruts...@confluent.io.invalid> wrote: >> > >> >> > >>> Hi Hanyu, >> > >>> >> > >>> reading the KIP, I was wondering the same thing as Bill. >> > >>> >> > >>> Other than that, this looks good to me. Thanks for KIP. >> > >>> >> > >>> nit: you have method names `LowerBound` and `UpperBound`, where you >> > >>> probably want to fix the capitalization. >> > >>> >> > >>> Cheers, >> > >>> Lucas >> > >>> >> > >>> On Mon, Oct 23, 2023 at 5:46 PM Bill Bejeck <bbej...@gmail.com> >> wrote: >> > >>>> >> > >>>> Hey Hanyu, >> > >>>> >> > >>>> Thanks for the KIP, it's a welcomed addition. >> > >>>> Overall, the KIP looks good to me, I just have one comment. >> > >>>> >> > >>>> Can you discuss the expected behavior when a user executes a >> > timestamped >> > >>>> query against a non-timestamped store? I think it should throw an >> > >>>> exception vs. using some default value. >> > >>>> If it's the case that Kafka Stream wraps all stores in a >> > >>>> `TimestampAndValue` store and returning a plain `V` or a >> > >>>> `TimestampAndValue<V>` object depends on the query type, then it >> would >> > >>> be >> > >>>> good to add those details to the KIP. >> > >>>> >> > >>>> Thanks, >> > >>>> Bill >> > >>>> >> > >>>> >> > >>>> >> > >>>> On Fri, Oct 20, 2023 at 5:07 PM Hanyu (Peter) Zheng >> > >>>> <pzh...@confluent.io.invalid> wrote: >> > >>>> >> > >>>>> Thank you Matthias, >> > >>>>> >> > >>>>> I will modify the KIP to eliminate this restriction. >> > >>>>> >> > >>>>> Sincerely, >> > >>>>> Hanyu >> > >>>>> >> > >>>>> On Fri, Oct 20, 2023 at 2:04 PM Hanyu (Peter) Zheng < >> > >>> pzh...@confluent.io> >> > >>>>> wrote: >> > >>>>> >> > >>>>>> Thank you Alieh, >> > >>>>>> >> > >>>>>> In these two new query types, I will remove 'get' from all getter >> > >>> method >> > >>>>>> names. >> > >>>>>> >> > >>>>>> Sincerely, >> > >>>>>> Hanyu >> > >>>>>> >> > >>>>>> On Fri, Oct 20, 2023 at 10:40 AM Matthias J. Sax < >> mj...@apache.org> >> > >>>>> wrote: >> > >>>>>> >> > >>>>>>> Thanks for the KIP Hanyu, >> > >>>>>>> >> > >>>>>>> One questions: >> > >>>>>>> >> > >>>>>>>> To address this inconsistency, we propose that KeyQuery should >> > >>> be >> > >>>>>>> restricted to querying kv-stores only, ensuring that it always >> > >>> returns >> > >>>>> a >> > >>>>>>> plain V type, making the behavior of the aforementioned code >> more >> > >>>>>>> predictable. Similarly, RangeQuery should be dedicated to >> querying >> > >>>>>>> kv-stores , consistently returning only the plain V . >> > >>>>>>> >> > >>>>>>> Why do you want to restrict `KeyQuery` and `RangeQuery` to >> > >>> kv-stores? I >> > >>>>>>> think it would be possible to still allow both queries for >> > >>> ts-kv-stores, >> > >>>>>>> but change the implementation to return "plain V" instead of >> > >>>>>>> `ValueAndTimestamp<V>`, ie, the implementation would >> automatically >> > >>>>>>> unwrap the value. >> > >>>>>>> >> > >>>>>>> >> > >>>>>>> >> > >>>>>>> -Matthias >> > >>>>>>> >> > >>>>>>> On 10/20/23 2:32 AM, Alieh Saeedi wrote: >> > >>>>>>>> Hey Hanyu, >> > >>>>>>>> >> > >>>>>>>> Thanks for the KIP. It seems good to me. >> > >>>>>>>> Just one point: AFAIK, we are going to remove "get" from the >> > >>> name of >> > >>>>> all >> > >>>>>>>> getter methods. >> > >>>>>>>> >> > >>>>>>>> Cheers, >> > >>>>>>>> Alieh >> > >>>>>>>> >> > >>>>>>>> On Thu, Oct 19, 2023 at 5:44 PM Hanyu (Peter) Zheng >> > >>>>>>>> <pzh...@confluent.io.invalid> wrote: >> > >>>>>>>> >> > >>>>>>>>> Hello everyone, >> > >>>>>>>>> >> > >>>>>>>>> I would like to start the discussion for KIP-992: Proposal to >> > >>>>> introduce >> > >>>>>>>>> IQv2 Query Types: TimestampedKeyQuery and >> TimestampedRangeQuery >> > >>>>>>>>> >> > >>>>>>>>> The KIP can be found here: >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>> >> > >>>>> >> > >>> >> > >> https://cwiki.apache.org/confluence/display/KAFKA/KIP-992%3A+Proposal+to+introduce+IQv2+Query+Types%3A+TimestampedKeyQuery+and+TimestampedRangeQuery >> > >>>>>>>>> >> > >>>>>>>>> Any suggestions are more than welcome. >> > >>>>>>>>> >> > >>>>>>>>> Many thanks, >> > >>>>>>>>> Hanyu >> > >>>>>>>>> >> > >>>>>>>>> On Thu, Oct 19, 2023 at 8:17 AM Hanyu (Peter) Zheng < >> > >>>>>>> pzh...@confluent.io> >> > >>>>>>>>> wrote: >> > >>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>> >> > >>>>>>> >> > >>>>> >> > >>> >> > >> https://cwiki.apache.org/confluence/display/KAFKA/KIP-992%3A+Proposal+to+introduce+IQv2+Query+Types%3A+TimestampedKeyQuery+and+TimestampedRangeQuery >> > >>>>>>>>>> >> > >>>>>>>>>> -- >> > >>>>>>>>>> >> > >>>>>>>>>> [image: Confluent] <https://www.confluent.io> >> > >>>>>>>>>> Hanyu (Peter) Zheng he/him/his >> > >>>>>>>>>> Software Engineer Intern >> > >>>>>>>>>> +1 (213) 431-7193 <+1+(213)+431-7193> >> > >>>>>>>>>> Follow us: [image: Blog] >> > >>>>>>>>>> < >> > >>>>>>>>> >> > >>>>>>> >> > >>>>> >> > >>> >> > >> https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog >> > >>>>>>>>>> [image: >> > >>>>>>>>>> Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] >> > >>>>>>>>>> <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: >> Slack] >> > >>>>>>>>>> <https://slackpass.io/confluentcommunity>[image: YouTube] >> > >>>>>>>>>> <https://youtube.com/confluent> >> > >>>>>>>>>> >> > >>>>>>>>>> [image: Try Confluent Cloud for Free] >> > >>>>>>>>>> < >> > >>>>>>>>> >> > >>>>>>> >> > >>>>> >> > >>> >> > >> https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic >> > >>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> -- >> > >>>>>>>>> >> > >>>>>>>>> [image: Confluent] <https://www.confluent.io> >> > >>>>>>>>> Hanyu (Peter) Zheng he/him/his >> > >>>>>>>>> Software Engineer Intern >> > >>>>>>>>> +1 (213) 431-7193 <+1+(213)+431-7193> >> > >>>>>>>>> Follow us: [image: Blog] >> > >>>>>>>>> < >> > >>>>>>>>> >> > >>>>>>> >> > >>>>> >> > >>> >> > >> https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog >> > >>>>>>>>>> [image: >> > >>>>>>>>> Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] >> > >>>>>>>>> <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: >> Slack] >> > >>>>>>>>> <https://slackpass.io/confluentcommunity>[image: YouTube] >> > >>>>>>>>> <https://youtube.com/confluent> >> > >>>>>>>>> >> > >>>>>>>>> [image: Try Confluent Cloud for Free] >> > >>>>>>>>> < >> > >>>>>>>>> >> > >>>>>>> >> > >>>>> >> > >>> >> > >> https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic >> > >>>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>> >> > >>>>>> >> > >>>>>> >> > >>>>>> -- >> > >>>>>> >> > >>>>>> [image: Confluent] <https://www.confluent.io> >> > >>>>>> Hanyu (Peter) Zheng he/him/his >> > >>>>>> Software Engineer Intern >> > >>>>>> +1 (213) 431-7193 <+1+(213)+431-7193> >> > >>>>>> Follow us: [image: Blog] >> > >>>>>> < >> > >>>>> >> > >>> >> > >> https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog >> > >>>>>> [image: >> > >>>>>> Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] >> > >>>>>> <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: Slack] >> > >>>>>> <https://slackpass.io/confluentcommunity>[image: YouTube] >> > >>>>>> <https://youtube.com/confluent> >> > >>>>>> >> > >>>>>> [image: Try Confluent Cloud for Free] >> > >>>>>> < >> > >>>>> >> > >>> >> > >> https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic >> > >>>>>> >> > >>>>>> >> > >>>>> >> > >>>>> >> > >>>>> -- >> > >>>>> >> > >>>>> [image: Confluent] <https://www.confluent.io> >> > >>>>> Hanyu (Peter) Zheng he/him/his >> > >>>>> Software Engineer Intern >> > >>>>> +1 (213) 431-7193 <+1+(213)+431-7193> >> > >>>>> Follow us: [image: Blog] >> > >>>>> < >> > >>>>> >> > >>> >> > >> https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog >> > >>>>>> [image: >> > >>>>> Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] >> > >>>>> <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: Slack] >> > >>>>> <https://slackpass.io/confluentcommunity>[image: YouTube] >> > >>>>> <https://youtube.com/confluent> >> > >>>>> >> > >>>>> [image: Try Confluent Cloud for Free] >> > >>>>> < >> > >>>>> >> > >>> >> > >> https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic >> > >>>>>> >> > >>>>> >> > >>> >> > >> >> > >> >> > >> -- >> > >> >> > >> [image: Confluent] <https://www.confluent.io> >> > >> Hanyu (Peter) Zheng he/him/his >> > >> Software Engineer Intern >> > >> +1 (213) 431-7193 <+1+(213)+431-7193> >> > >> Follow us: [image: Blog] >> > >> < >> > >> https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog >> > >[image: >> > >> Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] >> > >> <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: Slack] >> > >> <https://slackpass.io/confluentcommunity>[image: YouTube] >> > >> <https://youtube.com/confluent> >> > >> >> > >> [image: Try Confluent Cloud for Free] >> > >> < >> > >> https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic >> > > >> > >> >> > > >> > > >> > >> > > > -- > > [image: Confluent] <https://www.confluent.io> > Hanyu (Peter) Zheng he/him/his > Software Engineer Intern > +1 (213) 431-7193 <+1+(213)+431-7193> > Follow us: [image: Blog] > <https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog>[image: > Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] > <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: Slack] > <https://slackpass.io/confluentcommunity>[image: YouTube] > <https://youtube.com/confluent> > > [image: Try Confluent Cloud for Free] > <https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic> > -- [image: Confluent] <https://www.confluent.io> Hanyu (Peter) Zheng he/him/his Software Engineer Intern +1 (213) 431-7193 <+1+(213)+431-7193> Follow us: [image: Blog] <https://www.confluent.io/blog?utm_source=footer&utm_medium=email&utm_campaign=ch.email-signature_type.community_content.blog>[image: Twitter] <https://twitter.com/ConfluentInc>[image: LinkedIn] <https://www.linkedin.com/in/hanyu-peter-zheng/>[image: Slack] <https://slackpass.io/confluentcommunity>[image: YouTube] <https://youtube.com/confluent> [image: Try Confluent Cloud for Free] <https://www.confluent.io/get-started?utm_campaign=tm.fm-apac_cd.inbound&utm_source=gmail&utm_medium=organic>