You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Ritesh Kapoor <ri...@gmail.com> on 2019/06/12 18:14:44 UTC

Streaming Group By Query

Hi

I’m trying to use calcite streaming functionality. Need some help in understanding the behaviour of following query over infinite stream.

select STREAM ceil(ROWTIME TO SECOND) as r, C2,count(*) as c FROM S.TB GROUP BY ceil(ROWTIME TO SECOND),C2

 Will the above query emit row after every second?
Actually I was not able get working example of streaming table which emits rows as mentioned in query. The query gets stuck when executed.

Thanks and Regards
Ritesh Kapoor

Re: Streaming Group By Query

Posted by Ritesh Kapoor <ri...@gmail.com>.
I have simply edited one of the test case in calcite StreamTest to execute
a stream query and iterate over the results and print. But it doesn't seems
to work. It doesn't throw any error. As soon as I change stream from
INFINITE_STREAM_SCHEMA_NAME
to STREAMS query ends with results. Thank you for help

Thanks and Regards
Ritesh Kapoor

On Thu, Jun 13, 2019 at 9:25 AM Danny Chan <yu...@gmail.com> wrote:

> Then please tell us how you use it and what the stack trace throws ?
>
> Best,
> Danny Chan
> 在 2019年6月13日 +0800 AM10:55,Ritesh Kapoor <
> riteshkapoor.opensource@gmail.com>,写道:
> > Thanks Danny. But I couldn't get the attached test case working.
> >
> > > On Thu, Jun 13, 2019 at 7:57 AM Danny Chan <yu...@gmail.com>
> wrote:
> > > > Based on the doc, for tumbling window you use, I believe it is one
> second an emit.
> > > >
> > > > [1] https://calcite.apache.org/docs/stream.html
> > > >
> > > > Best,
> > > > Danny Chan
> > > > 在 2019年6月13日 +0800 AM2:14,Ritesh Kapoor <
> riteshkapoor.opensource@gmail.com>,写道:
> > > > > Hi
> > > > >
> > > > > I’m trying to use calcite streaming functionality. Need some help
> in understanding the behaviour of following query over infinite stream.
> > > > >
> > > > > select STREAM ceil(ROWTIME TO SECOND) as r, C2,count(*) as c FROM
> S.TB GROUP BY ceil(ROWTIME TO SECOND),C2
> > > > >
> > > > > Will the above query emit row after every second?
> > > > > Actually I was not able get working example of streaming table
> which emits rows as mentioned in query. The query gets stuck when executed.
> > > > >
> > > > > Thanks and Regards
> > > > > Ritesh Kapoor
>

Re: Streaming Group By Query

Posted by Danny Chan <yu...@gmail.com>.
Then please tell us how you use it and what the stack trace throws ?

Best,
Danny Chan
在 2019年6月13日 +0800 AM10:55,Ritesh Kapoor <ri...@gmail.com>,写道:
> Thanks Danny. But I couldn't get the attached test case working.
>
> > On Thu, Jun 13, 2019 at 7:57 AM Danny Chan <yu...@gmail.com> wrote:
> > > Based on the doc, for tumbling window you use, I believe it is one second an emit.
> > >
> > > [1] https://calcite.apache.org/docs/stream.html
> > >
> > > Best,
> > > Danny Chan
> > > 在 2019年6月13日 +0800 AM2:14,Ritesh Kapoor <ri...@gmail.com>,写道:
> > > > Hi
> > > >
> > > > I’m trying to use calcite streaming functionality. Need some help in understanding the behaviour of following query over infinite stream.
> > > >
> > > > select STREAM ceil(ROWTIME TO SECOND) as r, C2,count(*) as c FROM S.TB GROUP BY ceil(ROWTIME TO SECOND),C2
> > > >
> > > > Will the above query emit row after every second?
> > > > Actually I was not able get working example of streaming table which emits rows as mentioned in query. The query gets stuck when executed.
> > > >
> > > > Thanks and Regards
> > > > Ritesh Kapoor

Re: Streaming Group By Query

Posted by Ritesh Kapoor <ri...@gmail.com>.
Thanks Danny. But I couldn't get the attached test case working.

On Thu, Jun 13, 2019 at 7:57 AM Danny Chan <yu...@gmail.com> wrote:

> Based on the doc, for tumbling window you use, I believe it is one second
> an emit.
>
> [1] https://calcite.apache.org/docs/stream.html
>
> Best,
> Danny Chan
> 在 2019年6月13日 +0800 AM2:14,Ritesh Kapoor <riteshkapoor.opensource@gmail.com
> >,写道:
> > Hi
> >
> > I’m trying to use calcite streaming functionality. Need some help in
> understanding the behaviour of following query over infinite stream.
> >
> > select STREAM ceil(ROWTIME TO SECOND) as r, C2,count(*) as c FROM S.TB
> GROUP BY ceil(ROWTIME TO SECOND),C2
> >
> > Will the above query emit row after every second?
> > Actually I was not able get working example of streaming table which
> emits rows as mentioned in query. The query gets stuck when executed.
> >
> > Thanks and Regards
> > Ritesh Kapoor
>

Re: Streaming Group By Query

Posted by Danny Chan <yu...@gmail.com>.
Based on the doc, for tumbling window you use, I believe it is one second an emit.

[1] https://calcite.apache.org/docs/stream.html

Best,
Danny Chan
在 2019年6月13日 +0800 AM2:14,Ritesh Kapoor <ri...@gmail.com>,写道:
> Hi
>
> I’m trying to use calcite streaming functionality. Need some help in understanding the behaviour of following query over infinite stream.
>
> select STREAM ceil(ROWTIME TO SECOND) as r, C2,count(*) as c FROM S.TB GROUP BY ceil(ROWTIME TO SECOND),C2
>
> Will the above query emit row after every second?
> Actually I was not able get working example of streaming table which emits rows as mentioned in query. The query gets stuck when executed.
>
> Thanks and Regards
> Ritesh Kapoor