Skip to Content
0

HANA Output Adapter doesn't update HANA table

Oct 28, 2016 at 12:49 PM

79

avatar image

I am in the process of creating a simple example streaming project with Smart Data Streaming. I have an HANA output adapter which sends filtered events to a table which has been created in HANA.

I did the following:

1. Created a HANA data service, provided the necessary SYSTEM credentials and got the connection up and running. (SDS is running on port 30016)

2. I created a table in HANA and was successfully able to "discover" this service from the "Smart Data Streaming Run Test Perspective".

However, when I connect my output adapter and configure the HANA settings for it to use(like source, schema, table name etc), I don't see it updating the values in the database table at ALL!

I manually created one entry in the HANA table(to check whether I have the necessary credentials to create entries) and looks like I do because I was able to successfully insert a row.

The issue here being my HANA output adapter does not seem to be connecting to the HANA table which has been created. Each time I click the properties of the output adapter from the Smart Data Streaming Development Perspective, I need to manually choose the correct connection because it seems to be picking the first connection by default(which it shouldn't - this is the "esp" data service which appears first in the list (not sure how this appeared)), I keep changing the option to use the second connection from the list(which is "esps", save it and compile it - but I am not sure whether it is registering it correctly and I do not see any new entries which are being created in the HANA table even though the preceding filter has the correct entries in it.

(Please zoom in to view the screenshot clearly)

Step by step images below:

https://goo.gl/fYHBpy ---- (Please zoom in to view the screenshots clearly)

Is there any way I can erase the first option ("esp:") from the list of data services? I do not see a place or method to erase this "esp" connection from HANA Studio. Is this mandatory? Because I expect the adapter to choose the "esps" connection (which has a data service connection to the HANA database) which is the 2nd connection in the data services list.

Could this be the cause of the error - that the data routed from my HANA output adapter does not reach the database table at all? Am I missing something here?

Kindly advise.

The CCL code of the project:-

CREATE INPUT STREAM VEHICLEDATA SCHEMA (VEHICLEID string ,
EVENT_TIME msdate ,
EVENT_NAME string ,
EVENT_DESC string ,
EVENT_VALUE string );
/**@SIMPLEQUERY=FILTER*/
CREATE OUTPUT STREAM SPEED_FILTER SCHEMA (
VEHICLEID string ,
EVENT_TIME msdate,
EVENT_NAME string ,
EVENT_DESC string ,
EVENT_VALUE string )
AS
SELECT * FROM VEHICLEDATA WHERE
VEHICLEDATA.EVENT_NAME = 'SPEED' ;
ATTACH OUTPUT ADAPTER HANA_Output1 TYPE hana_out
TO SPEED_FILTER
PROPERTIES
service = 'hanaservice' ,
sourceSchema = 'XXXXXX' ,
table = 'SPEED_HISTORY' ;

The HANA table which has been created using this SQL code:

CREATE COLUMN TABLE SPEED_HISTORY (
VEHICLEID NVARCHAR(10) NOT NULL,
EVENT_TIME TIMESTAMP NOT NULL,
EVENT_NAME NVARCHAR(10) NOT NULL,
EVENT_DESC NVARCHAR(20),
EVENT_VALUE NVARCHAR(50) NOT NULL,
PRIMARY KEY (VEHICLEID, EVENT_TIME, EVENT_NAME))
UNLOAD PRIORITY 5 AUTO MERGE;
1.png (11.9 kB)
3.png (38.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Robert Waywell
Oct 28, 2016 at 02:53 PM
0
,

I recommend working through the Freezer Monitoring tutorial which specifically includes a section on using the HANA Output adapter. The tutorial will also clean up some other issues for you such as the proper port to use for the SDS connect (3XX26 not 3XX16) and how to choose which server to connect to.

The Freezer Monitoring tutorial is available in the Tutorial Catalogue: http://go.sap.com/developer/tutorials.html?tag=products:technology-platform/sap-hana/sap-hana-smart-data-streaming&sort=latest_asc

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you! That helped. I used 'SYSTEM' to perform the same actions, it worked!

0