Skip to Content
0

Input Window is not Updating Data into HANA DB

Jan 03, 2017 at 11:09 AM

95

avatar image

Hi All,

I am using input Wiindow in my streaming Project.

When am using Input Stream it is successfully Updating my HANA DB.But it is not updating when am using Input Window.

The reason why am using Input Window is i need to perform some calculation on date before inserting the record.This calculation is only possible through Input Window.

In Streaming view it is showing the record after successfull calculation of my date.

Please find the below code and suggest the required changes.

CREATE MEMORY STORE myStore; CREATE SCHEMA mySchema (MACHINENAME string ,MACHINESTATE integer , TIME_DURATION bigdatetime , SEQ LONG ); CREATE SCHEMA mySchema_IN (MACHINENAME string ,MACHINESTATE integer , TIME_DURATION SECONDDATE , SEQ LONG ); CREATE SCHEMA mySchema_OUT (MACHINENAME STRING,MACHINESTATE INTEGER,TIME_DURATION SECONDDATE, SEQ LONG); CREATE INPUT WINDOW IWIN1 SCHEMA mySchema_IN PRIMARY KEY (SEQ) STORE myStore AUTOGENERATE ( SEQ ) ; CREATE OUTPUT WINDOW OWIN1 SCHEMA ( MACHINENAME string , MACHINESTATE integer , TIME_DURATION SECONDDATE , SEQ LONG ) PRIMARY KEY DEDUCED STORE myStore AS SELECT IWIN1.MACHINENAME MACHINENAME , IWIN1.MACHINESTATE MACHINESTATE , IWIN1.TIME_DURATION - 23400 TIME_DURATION , IWIN1.SEQ SEQ FROM IWIN1 ; ATTACH OUTPUT ADAPTER Hana_output TYPE hana_out TO OWIN1 PROPERTIES service = 'chandu' , sourceSchema = 'CBTECH_01' , table = 'PRAMODH_DATA' ; Regards,Shekar
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jeff Wootton
Jan 03, 2017 at 05:19 PM
0

Based on the CCL you shared, there's no obvious reason that the SDS writes would fail.  My guess is perhaps the structure of the HANA table you are tryign to write to is not compatible with the CCL output window.  I suggest you check the project logs to see if the project is logging errors on the writes.

But with that said, there is a problem with your CCL:  you have not defined retention policies (ie KEEP clauses) on  your windows, so they will grow unbounded, eventually consuming all system resources and causing the project to shut down.  Your calculation doesn't require any retention, so I would suggest using streams instead of windows.  You can do the same calculation in a stream:

CREATESCHEMA mySchema

(MACHINENAME string ,

MACHINESTATE integer ,

TIME_DURATION seconddate

);

CREATEINPUTSTREAM ISTRM1

SCHEMA mySchema;

CREATEOUTPUTSTREAM OSTRM1

SCHEMA mySchema

ASSELECT

ISTRM1.MACHINENAME MACHINENAME ,

ISTRM1.MACHINESTATE MACHINESTATE ,

ISTRM1.TIME_DURATION - 23400 TIME_DURATION

FROM ISTRM1 ;

P.S. - in the future please share formatted CCL. It's too hard to read without line breaks. If you are copying from Studio, paste it into another editor (I use Word Pad) first and then copy to the community, or else save it in a text file and add it as an attachment

Share
10 |10000 characters needed characters left characters exceeded