output throttle issue

View: New views
13 Messages — Rating Filter:   Alert me  

output throttle issue

by benjamine.leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 issue

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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.
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 issue

by benjamine.leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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@...]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
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

 

_______________________________________________

 

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 issue

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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.
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@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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

 

_______________________________________________

 

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 issue

by benjamine.leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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@...]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________


Re: output throttle issue

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
There 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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________



RE: output throttle issue

by benjamine.leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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@...]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________

 

_______________________________________________

 

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 issue

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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

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@... ]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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.leo n@..." < benjamine.leo n@...>
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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________

 

_______________________________________________

 

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 issue

by Alexandre Vasseur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You 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:
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

Best regards
Tom
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@... ]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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.leo n@..." < benjamine.leo n@...>


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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________

 

_______________________________________________

 

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 issue

by benjamine.leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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@...]
Sent: Thursday, November 05, 2009 8:42 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

You 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:

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

Best regards
Tom

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@... ]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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.leo n@..." < benjamine.leo n@...>


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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________

 

_______________________________________________

 

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 issue

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi 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@...]
Sent: Thursday, November 05, 2009 8:42 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

You 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:

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

Best regards
Tom

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@... ]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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.leo n@..." < benjamine.leo n@...>


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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________

 

_______________________________________________

 

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 issue

by benjamine.leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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@...]
Sent: Friday, November 06, 2009 6:54 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

Hi 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@...]
Sent: Thursday, November 05, 2009 8:42 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

You 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:

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

Best regards
Tom

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@... ]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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.leo n@..." < benjamine.leo n@...>


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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________


Re: output throttle issue

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
A 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@... ]
Sent: Friday, November 06, 2009 6:54 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

Hi 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.leo n@..." < benjamine.leo n@...>
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@...]
Sent: Thursday, November 05, 2009 8:42 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

You 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:

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

Best regards
Tom

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@... ]
Sent: Thursday, November 05, 2009 7:30 AM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

There 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.leo n@..." < benjamine.leo n@...>


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@... ]
Sent: Wednesday, November 04, 2009 7:06 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
If still having questions, please provide a short example of input and expected output.

Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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    


From: Thomas Bernhardt [mailto: bernhardttom@... ]
Sent: Tuesday, November 03, 2009 9:11 PM
To: user@...
Subject: Re: [esper-user] output throttle issue

 

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.
Best regards
Tom


From: " benjamine.leo n@..." < benjamine.leo n@...>
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.

_______________________________________________