|
View:
New views
13 Messages
—
Rating Filter:
Alert me
|
|
|
output throttle issueHello,
I need to throttle the output and publish every 2 seconds for each symbols that we received update in last 2 seconds once. Marketdata stream ( Symbol, price) IBM 12 MSFT 10 IBM 13 2 seconds - expected (MSFT 10, IBM 13) MSFT 11 2 seconds - expected ( MSFT 11) I tried all these and I could not get proper results. It is really giving me all updates within 2 seconds. select * from Marketdata group by symbol output every 2 seconds select distinct * from Marketdata.std:unique(symbol).std:lastevent() output every 2 seconds select distinct * from Marketdata.std:unique(symbol) output every 2 seconds select * from Marketdata.std:unique(symbol) output every 2 seconds select * from Marketdata group by symbol output last every 2 seconds ( gives only one result) Can you suggest how to fix this issue? Ben Leon _______________________________________________ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: output throttle issueIf you event has other properties then just symbol and price these other properies can alone make it distinct, so "select distinct symbol, price" is an option or remove those other properties from the event.
Best regards Tom From: "benjamine.leon@..." <benjamine.leon@...> To: user@... Sent: Tue, November 3, 2009 7:38:34 PM Subject: [esper-user] output throttle issue Hello, I need to throttle the output and publish every 2 seconds for each symbols that we received update in last 2 seconds once. Marketdata stream ( Symbol, price) IBM 12 MSFT 10 IBM 13 2 seconds - expected (MSFT 10, IBM 13) MSFT 11 2 seconds - expected ( MSFT 11) I tried all these and I could not get proper results. It is really giving me all updates within 2 seconds. select * from Marketdata group by symbol output every 2 seconds select distinct * from Marketdata.std:unique(symbol).std:lastevent() output every 2 seconds select distinct * from Marketdata.std:unique(symbol) output every 2 seconds select * from Marketdata.std:unique(symbol) output every 2 seconds select * from Marketdata group by symbol output last every 2 seconds ( gives only one result) Can you suggest how to fix this issue? Ben Leon _______________________________________________ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
RE: output throttle issueI tried distinct and distinct does not
help , since we need both symbol & price in the query. Price is always
going to be different, so we still get multiple updates within 2 seconds. We need to group by symbol and for a given
symbol, we would like to output the lastevent only once every 2 seconds, if we
have received update within the 2 seconds. Is there any other workaround for
this? Ben Leon Barclays
Capital +1 212.320.6291
8.320.6291 From: Thomas
Bernhardt [mailto: If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: " _______________________________________________ This e-mail may contain
information that is confidential, privileged or otherwise protected from
disclosure. If you are not an intended recipient of this e-mail, do not
duplicate or redistribute it by any means. Please delete it and any attachments
and notify the sender that you have received it in error. Unless specifically
indicated, this e-mail is not an offer to buy or sell or a solicitation to buy
or sell any securities, investment products or other financial product or
service, an official confirmation of any transaction, or an official statement
of Barclays. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging
with Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ |
|
|
Re: output throttle issueSo you want the last price per symbol every 2 sec and not the last price/symbol combination every 2 sec? In this case you'd want to group by symbol.
If still having questions, please provide a short example of input and expected output. Best regards Tom From: "benjamine.leon@..." <benjamine.leon@...> To: user@... Sent: Wed, November 4, 2009 6:58:52 PM Subject: RE: [esper-user] output throttle issue I tried distinct and distinct does not help , since we need both symbol & price in the query. Price is always going to be different, so we still get multiple updates within 2 seconds.
We need to group by symbol and for a given symbol, we would like to output the lastevent only once every 2 seconds, if we have received update within the 2 seconds. Is there any other workaround for this?
Ben Leon Barclays Capital +1 212.320.6291 8.320.6291 From: Thomas
Bernhardt [mailto: bernhardttom@... ]
If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: "
benjamine.leo n@..." <
benjamine.leo n@...>
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ |
|
|
RE: output throttle issueThis is a quick sample reproducing the
issue private
class MarketData { public
AccountToClient(String symbol, double price) {this.symbol = symbol; this.price
= price;} public
String symbol; public String getSymbol() {return symbol;} public
double price; public String getPrice() {return price;} } esperAdmin.getConfiguration().addEventType("MarketData",
MarketData.class); EPStatement
statement1 = esperAdmin.createEPL("select * from MarketData group by
symbol output every 2 seconds"); statement1.addListener(this);
//this listener prints the output. I am using * in query because I need both
symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10));
esperRuntime.sendEvent(new MarketData("MSFT", 20));
esperRuntime.sendEvent(new MarketData("IBM", 30)); try{
Thread.sleep(5000) }catch(Exception ex){} During this sleep, the expected output at
the 2nd second is MSFT 20 IBM 30 But I see all three events in the output. Also when there are no events within
last 2 second, the listener class is still called with null eventbean. Ben Leon From: Thomas
Bernhardt [mailto: So you want the last price per
symbol every 2 sec and not the last price/symbol combination every 2 sec? In
this case you'd want to group by symbol. From: " I tried distinct and
distinct does not help , since we need both symbol & price in the query.
Price is always going to be different, so we still get multiple updates within
2 seconds. We need to group by
symbol and for a given symbol, we would like to output the lastevent only once
every 2 seconds, if we have received update within the 2 seconds. Is there any
other workaround for this? Ben
Leon From: Thomas
Bernhardt [mailto: If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: " _______________________________________________ This e-mail may contain
information that is confidential, privileged or otherwise protected from
disclosure. If you are not an intended recipient of this e-mail, do not
duplicate or redistribute it by any means. Please delete it and any attachments
and notify the sender that you have received it in error. Unless specifically
indicated, this e-mail is not an offer to buy or sell or a solicitation to buy
or sell any securities, investment products or other financial product or
service, an official confirmation of any transaction, or an official statement
of Barclays. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging
with Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ |
|
|
Re: output throttle issueThere is "output last" that should help, ie."select * from MarketData group by
symbol output last every 2 seconds" or use the last(price) aggregation function in the select. Best regards
Tom From: "benjamine.leon@..." <benjamine.leon@...> To: user@... Sent: Wed, November 4, 2009 10:26:29 PM Subject: RE: [esper-user] output throttle issue This is a quick sample reproducing the issue
private class MarketData { public AccountToClient(String symbol, double price) {this.symbol = symbol; this.price = price;} public String symbol; public String getSymbol() {return symbol;} public double price; public String getPrice() {return price;} }
esperAdmin.getConfiguration().addEventType("MarketData", MarketData.class); EPStatement statement1 = esperAdmin.createEPL("select * from MarketData group by symbol output every 2 seconds"); statement1.addListener(this); //this listener prints the output. I am using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10)); esperRuntime.sendEvent(new MarketData("MSFT", 20)); esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){}
During this sleep, the expected output at the 2nd second is MSFT 20 IBM 30
But I see all three events in the output.
Also when there are no events within last 2 second, the listener class is still called with null eventbean.
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ]
So you want the last price per
symbol every 2 sec and not the last price/symbol combination every 2 sec? In
this case you'd want to group by symbol. From: "
benjamine.leo n@..." <
benjamine.leo n@...> I tried distinct and distinct does not help , since we need both symbol & price in the query. Price is always going to be different, so we still get multiple updates within 2 seconds.
We need to group by symbol and for a given symbol, we would like to output the lastevent only once every 2 seconds, if we have received update within the 2 seconds. Is there any other workaround for this?
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@...
]
If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: "
benjamine.leo n@..." <
benjamine.leo n@...>
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ |
|
|
RE: output throttle issueI have tried ‘last’ before and
it gives only one result. For the sample I have given below, it
prints, IBM 30. MSFT is not printed Ben Leon From: Thomas
Bernhardt [mailto: There is "output last" that should help, ie."select * from MarketData group by symbol
output last every 2 seconds" Best regards From: " This is a quick sample
reproducing the issue
private class MarketData {
public AccountToClient(String symbol, double price) {this.symbol = symbol;
this.price = price;}
public String symbol; public String getSymbol() {return symbol;}
public double price; public String getPrice() {return price;}
}
esperAdmin.getConfiguration().addEventType("MarketData",
MarketData.class);
EPStatement statement1 =
esperAdmin.createEPL("select * from MarketData group by symbol output
every 2 seconds");
statement1.addListener(this); //this listener prints the output. I am
using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10));
esperRuntime.sendEvent(new MarketData("MSFT", 20));
esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){} During this sleep, the
expected output at the 2nd second is MSFT 20 IBM 30 But I see all three
events in the output. Also when there are
no events within last 2 second, the listener class is still called with null
eventbean. Ben
Leon From: Thomas
Bernhardt [mailto: So you want the last price per
symbol every 2 sec and not the last price/symbol combination every 2 sec? In
this case you'd want to group by symbol. From: " I tried
distinct and distinct does not help , since we need both symbol & price in
the query. Price is always going to be different, so we still get multiple
updates within 2 seconds. We need
to group by symbol and for a given symbol, we would like to output the
lastevent only once every 2 seconds, if we have received update within the 2
seconds. Is there any other workaround for this? Ben
Leon From: Thomas
Bernhardt [mailto: If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: " _______________________________________________ This e-mail may contain information that is
confidential, privileged or otherwise protected from disclosure. If you are not
an intended recipient of this e-mail, do not duplicate or redistribute it by
any means. Please delete it and any attachments and notify the sender that you
have received it in error. Unless specifically indicated, this e-mail is not an
offer to buy or sell or a solicitation to buy or sell any securities,
investment products or other financial product or service, an official
confirmation of any transaction, or an official statement of Barclays. Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging with
Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ _______________________________________________ This e-mail may contain
information that is confidential, privileged or otherwise protected from
disclosure. If you are not an intended recipient of this e-mail, do not
duplicate or redistribute it by any means. Please delete it and any attachments
and notify the sender that you have received it in error. Unless specifically
indicated, this e-mail is not an offer to buy or sell or a solicitation to buy
or sell any securities, investment products or other financial product or
service, an official confirmation of any transaction, or an official statement
of Barclays. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging
with Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ |
|
|
Re: output throttle issueYou may have tried 'output last' without group-by, the 'last' keyword works together with group-by to output the last row per group, see http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html_single/index.html#epl-output-rate
Best regards Tom From: "benjamine.leon@..." <benjamine.leon@...> To: user@... Sent: Thu, November 5, 2009 7:48:38 AM Subject: RE: [esper-user] output throttle issue I have tried ‘last’ before and it gives only one result.
For the sample I have given below, it prints, IBM 30. MSFT is not printed
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ]
There is "output last" that should help, ie."select * from MarketData group by symbol
output last every 2 seconds" Best regards From: "
benjamine.leo n@..." <
benjamine.leo n@...> This is a quick sample reproducing the issue
private class MarketData { public AccountToClient(String symbol, double price) {this.symbol = symbol; this.price = price;} public String symbol; public String getSymbol() {return symbol;} public double price; public String getPrice() {return price;} }
esperAdmin.getConfiguration().addEventType("MarketData", MarketData.class); EPStatement statement1 = esperAdmin.createEPL("select * from MarketData group by symbol output every 2 seconds"); statement1.addListener(this); //this listener prints the output. I am using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10)); esperRuntime.sendEvent(new MarketData("MSFT", 20)); esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){}
During this sleep, the expected output at the 2nd second is MSFT 20 IBM 30
But I see all three events in the output.
Also when there are no events within last 2 second, the listener class is still called with null eventbean.
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@...
]
So you want the last price per
symbol every 2 sec and not the last price/symbol combination every 2 sec? In
this case you'd want to group by symbol. From: "
benjamine.leo n@..." <
benjamine.leo n@...> I tried distinct and distinct does not help , since we need both symbol & price in the query. Price is always going to be different, so we still get multiple updates within 2 seconds.
We need to group by symbol and for a given symbol, we would like to output the lastevent only once every 2 seconds, if we have received update within the 2 seconds. Is there any other workaround for this?
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@...
]
If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: "
benjamine.leo n@..." <
benjamine.leo n@...>
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ |
|
|
Re: output throttle issueYou may also consider the following:
select * from MarketData.std:unique(symbol).win:time(2.1 seconds) output snapshot every 2 seconds Alex On Thu, Nov 5, 2009 at 2:26 PM, Thomas Bernhardt <bernhardttom@...> wrote:
|
|
|
RE: output throttle issueThanks Alex. Your solution worked. With group by & last does not work. I
am not sure whether this is a bug. select * from MarketData group by symbol
output last every 2 seconds Ben Leon From: Alexandre
Vasseur [mailto:avasseur@...] You may also consider the following: On Thu, Nov 5, 2009 at 2:26 PM, Thomas Bernhardt <bernhardttom@...> wrote: You may have tried 'output last'
without group-by, the 'last' keyword works together with group-by to output the
last row per group, see http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html_single/index.html#epl-output-rate From: "benjamine.leon@..."
<benjamine.leon@...> Sent: Thu,
November 5, 2009 7:48:38 AM
I have tried ‘last’ before and it gives
only one result. For the sample I have given below, it prints,
IBM 30. MSFT is not printed Ben
Leon From: Thomas Bernhardt
[mailto: bernhardttom@...
] There is "output last" that should help, ie."select * from MarketData group by symbol
output last every 2 seconds" Best regards From: "
This is a quick sample reproducing the
issue
private class MarketData {
public AccountToClient(String symbol, double price) {this.symbol = symbol;
this.price = price;}
public String symbol; public String getSymbol() {return symbol;}
public double price; public String getPrice() {return price;}
}
esperAdmin.getConfiguration().addEventType("MarketData",
MarketData.class);
EPStatement statement1 =
esperAdmin.createEPL("select * from MarketData group by symbol output
every 2 seconds");
statement1.addListener(this); //this listener prints the output. I am
using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10));
esperRuntime.sendEvent(new MarketData("MSFT", 20));
esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){} During this sleep, the expected output at
the 2nd second is MSFT 20 IBM 30 But I see all three events in the output. Also when there are no events within
last 2 second, the listener class is still called with null eventbean. Ben
Leon From: Thomas Bernhardt
[mailto: bernhardttom@...
] So you want the last price per symbol every 2 sec and not
the last price/symbol combination every 2 sec? In this case you'd want to group
by symbol. From: " I tried distinct and distinct does not
help , since we need both symbol & price in the query. Price is always
going to be different, so we still get multiple updates within 2 seconds. We need to group by symbol and for a given
symbol, we would like to output the lastevent only once every 2 seconds, if we
have received update within the 2 seconds. Is there any other workaround for
this? Ben
Leon From: Thomas Bernhardt
[mailto: bernhardttom@...
] If you event has other properties then just symbol and price
these other properies can alone make it distinct, so "select distinct
symbol, price" is an option or remove those other properties from the
event. From: " _______________________________________________ This e-mail may contain information that is confidential, privileged or
otherwise protected from disclosure. If you are not an intended recipient of
this e-mail, do not duplicate or redistribute it by any means. Please delete it
and any attachments and notify the sender that you have received it in error.
Unless specifically indicated, this e-mail is not an offer to buy or sell or a
solicitation to buy or sell any securities, investment products or other
financial product or service, an official confirmation of any transaction, or
an official statement of Barclays. Any views or opinions presented are solely
those of the author and do not necessarily represent those of Barclays. This
e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the
foregoing. Barclays Capital is the investment banking division of
Barclays Bank PLC, a company registered in _______________________________________________ _______________________________________________ This e-mail may contain information that is
confidential, privileged or otherwise protected from disclosure. If you are not
an intended recipient of this e-mail, do not duplicate or redistribute it by
any means. Please delete it and any attachments and notify the sender that you
have received it in error. Unless specifically indicated, this e-mail is not an
offer to buy or sell or a solicitation to buy or sell any securities,
investment products or other financial product or service, an official
confirmation of any transaction, or an official statement of Barclays. Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging with
Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ _______________________________________________ This e-mail may contain
information that is confidential, privileged or otherwise protected from
disclosure. If you are not an intended recipient of this e-mail, do not
duplicate or redistribute it by any means. Please delete it and any attachments
and notify the sender that you have received it in error. Unless specifically
indicated, this e-mail is not an offer to buy or sell or a solicitation to buy
or sell any securities, investment products or other financial product or
service, an official confirmation of any transaction, or an official statement
of Barclays. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging
with Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ |
|
|
Re: output throttle issueHi Ben,
upon investigation a select wildcard with group-by and "output last" has a bug, we are tracking at http://jira.codehaus.org/browse/ESPER-419 The workaround is "select symbol,price from Stream group by symbol output last every 2 seconds", see JIRA. Best regards, Tom From: "benjamine.leon@..." <benjamine.leon@...> To: user@... Sent: Thu, November 5, 2009 11:15:58 AM Subject: RE: [esper-user] output throttle issue Thanks Alex. Your solution worked.
With group by & last does not work. I am not sure whether this is a bug. select * from MarketData group by symbol output last every 2 seconds Ben Leon From: Alexandre
Vasseur [mailto:avasseur@...]
You may also consider the following: On Thu, Nov 5, 2009 at 2:26 PM, Thomas Bernhardt <bernhardttom@...> wrote: You may have tried 'output last'
without group-by, the 'last' keyword works together with group-by to output the
last row per group, see http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html_single/index.html#epl-output-rate From: "benjamine.leon@..."
<benjamine.leon@...> Sent: Thu, November 5, 2009 7:48:38 AM
I have tried ‘last’ before and it gives only one result.
For the sample I have given below, it prints, IBM 30. MSFT is not printed
Ben Leon From: Thomas Bernhardt
[mailto: bernhardttom@...
]
There is "output last" that should help, ie."select * from MarketData group by symbol
output last every 2 seconds" Best regards From: " benjamine.leo n@..." < benjamine.leo n@...>
This is a quick sample reproducing the issue
private class MarketData { public AccountToClient(String symbol, double price) {this.symbol = symbol; this.price = price;} public String symbol; public String getSymbol() {return symbol;} public double price; public String getPrice() {return price;} }
esperAdmin.getConfiguration().addEventType("MarketData", MarketData.class); EPStatement statement1 = esperAdmin.createEPL("select * from MarketData group by symbol output every 2 seconds"); statement1.addListener(this); //this listener prints the output. I am using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10)); esperRuntime.sendEvent(new MarketData("MSFT", 20)); esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){}
During this sleep, the expected output at the 2nd second is MSFT 20 IBM 30
But I see all three events in the output.
Also when there are no events within last 2 second, the listener class is still called with null eventbean.
Ben Leon From: Thomas Bernhardt
[mailto: bernhardttom@...
]
So you want the last price per symbol every 2 sec and not
the last price/symbol combination every 2 sec? In this case you'd want to group
by symbol. From: "
benjamine.leo n@..." < benjamine.leo
n@...> I tried distinct and distinct does not help , since we need both symbol & price in the query. Price is always going to be different, so we still get multiple updates within 2 seconds.
We need to group by symbol and for a given symbol, we would like to output the lastevent only once every 2 seconds, if we have received update within the 2 seconds. Is there any other workaround for this?
Ben Leon From: Thomas Bernhardt
[mailto: bernhardttom@...
]
If you event has other properties then just symbol and price
these other properies can alone make it distinct, so "select distinct
symbol, price" is an option or remove those other properties from the
event. From: "
benjamine.leo n@..." < benjamine.leo
n@...>
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ |
|
|
RE: output throttle issueThanks for giving the work around. We have
lot of columns; we will put all the columns in the select query instead of
wildcard. Ben Leon From: Thomas
Bernhardt [mailto: Hi Ben, From: " Thanks Alex. Your
solution worked. With group by & last
does not work. I am not sure whether this is a bug. select * from MarketData
group by symbol output last every 2 seconds Ben Leon From: Alexandre
Vasseur [mailto:avasseur@...] You may also consider the following: On Thu, Nov 5, 2009 at 2:26 PM, Thomas Bernhardt <bernhardttom@...> wrote: You may have tried 'output last'
without group-by, the 'last' keyword works together with group-by to output the
last row per group, see http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html_single/index.html#epl-output-rate From: "benjamine.leon@..."
<benjamine.leon@...> Sent: Thu,
November 5, 2009 7:48:38 AM
I have
tried ‘last’ before and it gives only one result. For the
sample I have given below, it prints, IBM 30. MSFT is not printed Ben
Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ] There is "output last" that should help, ie."select * from MarketData group by symbol
output last every 2 seconds" Best regards From: "
This is
a quick sample reproducing the issue
private class MarketData {
public AccountToClient(String symbol, double price) {this.symbol = symbol;
this.price = price;}
public String symbol; public String getSymbol() {return symbol;}
public double price; public String getPrice() {return price;}
}
esperAdmin.getConfiguration().addEventType("MarketData",
MarketData.class);
EPStatement statement1 =
esperAdmin.createEPL("select * from MarketData group by symbol output
every 2 seconds");
statement1.addListener(this); //this listener prints the output. I am
using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10));
esperRuntime.sendEvent(new MarketData("MSFT", 20));
esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){} During
this sleep, the expected output at the 2nd second is MSFT 20 IBM 30 But I
see all three events in the output. Also
when there are no events within last 2 second, the listener class is
still called with null eventbean. Ben
Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ] So you want the last price per
symbol every 2 sec and not the last price/symbol combination every 2 sec? In
this case you'd want to group by symbol. From: " I tried
distinct and distinct does not help , since we need both symbol & price in
the query. Price is always going to be different, so we still get multiple
updates within 2 seconds. We need
to group by symbol and for a given symbol, we would like to output the
lastevent only once every 2 seconds, if we have received update within the 2
seconds. Is there any other workaround for this? Ben
Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ] If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: " _______________________________________________ This e-mail may contain
information that is confidential, privileged or otherwise protected from
disclosure. If you are not an intended recipient of this e-mail, do not
duplicate or redistribute it by any means. Please delete it and any attachments
and notify the sender that you have received it in error. Unless specifically
indicated, this e-mail is not an offer to buy or sell or a solicitation to buy
or sell any securities, investment products or other financial product or
service, an official confirmation of any transaction, or an official statement
of Barclays. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Barclays. This e-mail is subject to terms
available at the following link: www.barcap.com/emaildisclaimer.
By messaging
with Barclays you consent to the foregoing. Barclays Capital is the investment
banking division of Barclays Bank PLC, a company registered in _______________________________________________ |
|
|
Re: output throttle issueA single column will do as well, i.e. "select symbol as s, * from ...." if you care and plan to add properties later without changing the statement.
-Tom From: "benjamine.leon@..." <benjamine.leon@...> To: user@... Sent: Fri, November 6, 2009 6:07:26 PM Subject: RE: [esper-user] output throttle issue Thanks for giving the work around. We have lot of columns; we will put all the columns in the select query instead of wildcard.
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ]
Hi Ben, From: "
benjamine.leo n@..." <
benjamine.leo n@...> Thanks Alex. Your solution worked.
With group by & last does not work. I am not sure whether this is a bug. select * from MarketData group by symbol output last every 2 seconds Ben Leon From: Alexandre
Vasseur [mailto:avasseur@...]
You may also consider the following: On Thu, Nov 5, 2009 at 2:26 PM, Thomas Bernhardt <bernhardttom@...> wrote: You may have tried 'output last'
without group-by, the 'last' keyword works together with group-by to output the
last row per group, see http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html_single/index.html#epl-output-rate From: "benjamine.leon@..."
<benjamine.leon@...> Sent: Thu, November 5, 2009 7:48:38 AM
I have tried ‘last’ before and it gives only one result.
For the sample I have given below, it prints, IBM 30. MSFT is not printed
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ]
There is "output last" that should help, ie."select * from MarketData group by symbol
output last every 2 seconds" Best regards From: " benjamine.leo n@..." < benjamine.leo n@...>
This is a quick sample reproducing the issue
private class MarketData { public AccountToClient(String symbol, double price) {this.symbol = symbol; this.price = price;} public String symbol; public String getSymbol() {return symbol;} public double price; public String getPrice() {return price;} }
esperAdmin.getConfiguration().addEventType("MarketData", MarketData.class); EPStatement statement1 = esperAdmin.createEPL("select * from MarketData group by symbol output every 2 seconds"); statement1.addListener(this); //this listener prints the output. I am using * in query because I need both symbol & price in the output.
esperRuntime.sendEvent(new MarketData("IBM", 10)); esperRuntime.sendEvent(new MarketData("MSFT", 20)); esperRuntime.sendEvent(new MarketData("IBM", 30));
try{ Thread.sleep(5000) }catch(Exception ex){}
During this sleep, the expected output at the 2nd second is MSFT 20 IBM 30
But I see all three events in the output.
Also when there are no events within last 2 second, the listener class is still called with null eventbean.
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ]
So you want the last price per
symbol every 2 sec and not the last price/symbol combination every 2 sec? In
this case you'd want to group by symbol. From: "
benjamine.leo n@..."
< benjamine.leo n@...> I tried distinct and distinct does not help , since we need both symbol & price in the query. Price is always going to be different, so we still get multiple updates within 2 seconds.
We need to group by symbol and for a given symbol, we would like to output the lastevent only once every 2 seconds, if we have received update within the 2 seconds. Is there any other workaround for this?
Ben Leon From: Thomas
Bernhardt [mailto: bernhardttom@... ]
If you event has other properties
then just symbol and price these other properies can alone make it distinct, so
"select distinct symbol, price" is an option or remove those other
properties from the event. From: "
benjamine.leo n@..."
< benjamine.leo n@...>
_______________________________________________
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place , London , E14 5HP . This email may relate to or be sent from other members of the Barclays Group. _______________________________________________ |
| Free embeddable forum powered by Nabble | Forum Help |