|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
groupby(prop) not grouping aggregates !!Esper 3.1 : From the Docs -
" This example computes the total price for the last 5 events per each symbol: select symbol, sum(price) from StockTickEvent.std:groupby(symbol).win:length(5)" My sample using same statement - " select symbol,price, sum(price) from trade.std:groupby(symbol).win:length(5)" The result is no grouping by symbol OR length : IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=4348.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=4553.0} IN: {price=793.8, symbol=HDIL, sum(price)=5346.8} Without the groupby() : " select symbol,price, sum(price) from trade.win:length(5)" ..at least the 5 length window works. IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=2547.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=951.0} IN: {price=793.8, symbol=HDIL, sum(price)=1695.8} IN: {price=798.65, symbol=HDIL, sum(price)=2290.45} Pls advise comments asap. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: groupby(prop) not grouping aggregates !!http://esper.codehaus.org/esper-3.2.0/doc/reference/en/html_single/index.html#processingmodel_aggregation should explain some, since there is no group-by and your "price" property is ungrouped, its a case of event-per-row and not event-per-group. -Tom From: sandhu <sandhuqed@...> To: user@... Sent: Tuesday, September 8, 2009 3:51:13 AM Subject: [esper-user] groupby(prop) not grouping aggregates !! Esper 3.1 : From the Docs - " This example computes the total price for the last 5 events per each symbol: select symbol, sum(price) from StockTickEvent.std:groupby(symbol).win:length(5)" My sample using same statement - " select symbol,price, sum(price) from trade.std:groupby(symbol).win:length(5)" The result is no grouping by symbol OR length : IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=4348.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=4553.0} IN: {price=793.8, symbol=HDIL, sum(price)=5346.8} Without the groupby() : " select symbol,price, sum(price) from trade.win:length(5)" ..at least the 5 length window works. IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=2547.0} IN: {price=205.0, symbol=HINDALCO, sum(price)=951.0} IN: {price=793.8, symbol=HDIL, sum(price)=1695.8} IN: {price=798.65, symbol=HDIL, sum(price)=2290.45} Pls advise comments asap. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: groupby(prop) not grouping aggregates !!Hi Tom,
I think there is a problem with "std:groupby()".. because "group by" seems to work . As per docs http://esper.codehaus.org/esper-3.2.0/doc/reference/en/html_single/index.html#view-std-groupby "select symbol, sum(price) from StockTickEvent.std:groupby(symbol).win:length(5)" ..should aggregate *per symbol* but it does not. In fact it just keeps accumulating across all symbols *and* all events ..not just 5. Pls advise On Tue, Sep 8, 2009 at 5:16 PM, Thomas Bernhardt<bernhardttom@...> wrote: > http://esper.codehaus.org/esper-3.2.0/doc/reference/en/html_single/index.html#processingmodel_aggregation > should explain some, since there is no group-by and your "price" property is > ungrouped, its a case of event-per-row and not event-per-group. > -Tom > ________________________________ > From: sandhu <sandhuqed@...> > To: user@... > Sent: Tuesday, September 8, 2009 3:51:13 AM > Subject: [esper-user] groupby(prop) not grouping aggregates !! > > Esper 3.1 : From the Docs - > " This example computes the total price for the last 5 events per each > symbol: > select symbol, sum(price) from > StockTickEvent.std:groupby(symbol).win:length(5)" > > My sample using same statement - > " select symbol,price, sum(price) from > trade.std:groupby(symbol).win:length(5)" > > The result is no grouping by symbol OR length : > > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} > IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} > IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} > IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=4348.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=4553.0} > IN: {price=793.8, symbol=HDIL, sum(price)=5346.8} > > > Without the groupby() : " select symbol,price, sum(price) from > trade.win:length(5)" > ..at least the 5 length window works. > > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} > IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} > IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} > IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=2547.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=951.0} > IN: {price=793.8, symbol=HDIL, sum(price)=1695.8} > IN: {price=798.65, symbol=HDIL, sum(price)=2290.45} > > Pls advise comments asap. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: groupby(prop) not grouping aggregates !!So the doc reads: This example computes the total price for the last 5 events per each symbol: select symbol, sum(price) from StockTickEvent.std:groupby(symbol).win:length(5)With a separate data window per symbol, the aggregation is not per-symbol, it is across all symbols. We'll update the doc to make this a little clearer. Best regards, Tom From: sandhu <sandhuqed@...> To: user@... Sent: Tuesday, September 8, 2009 8:32:37 AM Subject: Re: [esper-user] groupby(prop) not grouping aggregates !! Hi Tom, I think there is a problem with "std:groupby()".. because "group by" seems to work . As per docs http://esper.codehaus.org/esper-3.2.0/doc/reference/en/html_single/index.html#view-std-groupby "select symbol, sum(price) from StockTickEvent.std:groupby(symbol).win:length(5)" ..should aggregate *per symbol* but it does not. In fact it just keeps accumulating across all symbols *and* all events ..not just 5. Pls advise On Tue, Sep 8, 2009 at 5:16 PM, Thomas Bernhardt<bernhardttom@...> wrote: > http://esper.codehaus.org/esper-3.2.0/doc/reference/en/html_single/index.html#processingmodel_aggregation > should explain some, since there is no group-by and your "price" property is > ungrouped, its a case of event-per-row and not event-per-group. > -Tom > ________________________________ > From: sandhu <sandhuqed@...> > To: user@... > Sent: Tuesday, September 8, 2009 3:51:13 AM > Subject: [esper-user] groupby(prop) not grouping aggregates !! > > Esper 3.1 : From the Docs - > " This example computes the total price for the last 5 events per each > symbol: > select symbol, sum(price) from > StockTickEvent.std:groupby(symbol).win:length(5)" > > My sample using same statement - > " select symbol,price, sum(price) from > trade.std:groupby(symbol).win:length(5)" > > The result is no grouping by symbol OR length : > > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} > IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} > IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} > IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=4348.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=4553.0} > IN: {price=793.8, symbol=HDIL, sum(price)=5346.8} > > > Without the groupby() : " select symbol,price, sum(price) from > trade.win:length(5)" > ..at least the 5 length window works. > > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=1801.0} > IN: {price=1801.0, symbol=BFUTILITIE, sum(price)=3602.0} > IN: {price=49.0, symbol=CENTBOP, sum(price)=3651.0} > IN: {price=204.0, symbol=HINDALCO, sum(price)=3855.0} > IN: {price=288.0, symbol=CAIRN, sum(price)=4143.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=2547.0} > IN: {price=205.0, symbol=HINDALCO, sum(price)=951.0} > IN: {price=793.8, symbol=HDIL, sum(price)=1695.8} > IN: {price=798.65, symbol=HDIL, sum(price)=2290.45} > > Pls advise comments asap. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Free embeddable forum powered by Nabble | Forum Help |