cancel
Showing results for 
Search instead for 
Did you mean: 

Getting blank data for the results .

venkataramana_paidi
Contributor
0 Kudos

Hi ,

I am new to SAP ESP . I am using Getting started guide  to build the sample ESP project .

Below is the screenshot of the my_portfolio_valuation project.

For the Positions stream I am using the positions.xml file from exampledata folder.

I tried to execute the project but I am getting blanks  for Pricefeed fields.

For the pricefeed I am using playback option to upload pricefeed.xml file after start run the project .

Please find the below screenshots for reference.

It seems It is giving the result before pricefeed upload only.

Why pricefeed data not reflecting on the result.  It is showing positions field data only as I am using right outer join  on positions ,

Please help me to resolve this issue.

Thanks & Regards,

Ramana.

Accepted Solutions (1)

Accepted Solutions (1)

JWootton
Advisor
Advisor
0 Kudos

I suggest you review the configuration of your CCL Join (IndividualPositions), as the screenshots suggest that's where the problem is - i.e. that the pricefeed "events" aren't matching any of the position records.  The fact that you see the price events in the PriceFeed stream viewer shows that playback is working and the price events are coming in.

One thing I see that appears wrong:  Positions is an input stream and PriceFeed is an input window.  These are backwards.  Positions should be an input window.  PriceFeed should be an input stream.

If you join a stream to a window,  only the stream events will "trigger" a join.  And since the positions don't change, if they aren't held in a window,  then the position information won't be there when the price change event arrives.

venkataramana_paidi
Contributor
0 Kudos

Thanks Jeff for your response .

I am using stream for the Pricefeed  but I am getting the below error .

Description    Resource    Path    Location    Type

[ESP-3-159213] Keyed Stream PriceFeed feeds Window VWAP without an explicit retention policy being specified. This is not alllowed.     my_portfolio_valuation2.cclnotation    /my_portfolio_valuation2    line 15 column 0    CCL Compiler

Please find the below screenshot.

Please find my CCL code  .

CREATE INPUT STREAM PriceFeed SCHEMA (

    Id INTEGER ,

    Symbol string ,

    TradeTime bigdatetime ,

    Price float ,

    Shares INTEGER ) PRIMARY KEY ( Id ) ;

/**@SIMPLEQUERY=AGGREGATE*/

CREATE OUTPUT WINDOW VWAP PRIMARY KEY DEDUCED KEEP ALL ROWS

AS

    SELECT

        PriceFeed.Symbol Symbol ,

        PriceFeed.TradeTime LastTime ,

        PriceFeed.Price LastPrice ,

        sum ( PriceFeed.Price * PriceFeed.Shares ) / sum ( PriceFeed.Shares ) VWAP FROM PriceFeed GROUP BY PriceFeed.Symbol ;

CREATE INPUT WINDOW Positions SCHEMA (

    BookId string ,

    Symbol string ,

    SharesHeld integer ) PRIMARY KEY ( BookId ) ;

/**@SIMPLEQUERY=JOIN*/

CREATE OUTPUT WINDOW IndividualPositions PRIMARY KEY DEDUCED

AS

    SELECT

        Positions.BookId BookId ,

        Positions.Symbol Symbol ,

        Positions.SharesHeld SharesHeld ,

        VWAP.LastTime LastTime ,

        VWAP.LastPrice LastPrice ,

        VWAP.VWAP VWAP ,

        ( VWAP.LastPrice * Positions.SharesHeld ) CurrentPosition ,

        ( VWAP.VWAP * Positions.SharesHeld ) AveragePosition FROM VWAP RIGHT JOIN Positions ON VWAP.Symbol = Positions.Symbol ;

/**@SIMPLEQUERY=AGGREGATE*/

CREATE OUTPUT WINDOW ValueByBook PRIMARY KEY DEDUCED

AS

    SELECT

        IndividualPositions.BookId BookId ,

        IndividualPositions.CurrentPosition CurrentPosition ,

        IndividualPositions.AveragePosition AveragePosition FROM IndividualPositions GROUP BY IndividualPositions.BookId ;

ATTACH INPUT ADAPTER Adapter1 TYPE toolkit_file_xmllist_input

TO Positions

PROPERTIES

    dir = 'C:/Users/Administrator/Documents/SybaseESP/5.1/workspace/exampledata' ,

    file = 'positions.xml' ;

Please suggest me how to resolve this issue.

Thanks & Regards,

Ramana.

JWootton
Advisor
Advisor
0 Kudos

You need to have a KEEP policy as part of your FROM clause on the Window,  otherwise you are creating an aggregation window (the set of events you are aggregating over) that will grow unbounded.

Also,  not that it matters,  but you really don't need the PRIMARY KEY clause on the input stream - it's not doing anything in this instance.

Strangely, if you remove the PRIMARY KEY clause from the input stream, you don't get the compiler error, even though you don't have the KEEP policy on the FROM,  but it's still a problem

(if you saw my earlier response, this bit through me off and I responded to quickly without realizing the lurking danger of the aggregation window)

So here's what it should look like (you can change the keep policy to be whatever you want - just not ALL:

CREATE INPUT STREAM PriceFeed

SCHEMA (    

  Id INTEGER ,    

  Symbol string ,    

  TradeTime bigdatetime ,    

  Price float ,    

  Shares INTEGER );

/**@SIMPLEQUERY=AGGREGATE*/

CREATE OUTPUT WINDOW VWAP

PRIMARY KEY DEDUCED

KEEP ALL ROWS

AS SELECT        

  PriceFeed.Symbol Symbol ,        

  PriceFeed.TradeTime LastTime ,        

  PriceFeed.Price LastPrice ,         

  sum ( PriceFeed.Price * PriceFeed.Shares ) / sum ( PriceFeed.Shares ) VWAP  

FROM PriceFeed KEEP 10 Min  

GROUP BY PriceFeed.Symbol ;

JWootton
Advisor
Advisor
0 Kudos

for more detail on creating windows from streams, and avoiding unbounded growth, see: http://scn.sap.com/docs/DOC-40921

Answers (0)