Showing posts with label HANA. Show all posts
Showing posts with label HANA. Show all posts

AWS EC2 Instance Experience with HANA

Move my code to AWS EC2 instance with HANA database... Only 100euro left for testing and keep running all day long took over 20 euros for the instance.

Before running on the server, it takes so long time to run the program on my laptop. Definitely, the HANA database by using column table can improve scan and select records:)

First to run Java programs in a Linux environment, and some takeaways are:


Keep running after ending the terminal session:
  • nohup java -Xmx16G -cp ../lib/*:./ io.github.parklize.viewer.TableViewer

Export the table and import to MySQL back:
  • 01. CMD LINE MySQL: 

LOAD DATA LOCAL INFILE '/Users/guangyuan/Downloads/data.csv' INTO TABLE RESIM.LOD_RANDOMRECORDSIM FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'(ID, USERID, ARTISTURI, @LDSDSIM, @VSMCOSINESIM, @RESIMSIM) SET LDSDSIM = NULLIF(@LDSDSIM,''), VSMCOSINESIM = NULLIF(@VSMCOSINESIM,''), RESIMSIM = NULLIF(@RESIMSIM,'') ;

  • 02. MODIFY USERID AND ARTISTURI BY USING SQL

UPDATE resim.LOD_RANDOMRECORDSIM SET USERID = substring(USERID,2,length(USERID)-2)
UPDATE resim.LOD_RANDOMRECORDSIM SET ARTISTURI = substring(ARTISTURI,2,length(ARTISTURI)-2)

Training on SAP HANA in SAP Dublin office

The second time after the first meeting of SAP-INSIGHT targeted project meeting on last March.


1. SAP and SAP Ireland Introduction.
    - It has over 1000+ employees and 500+ employees in Galway. Recent years it also has R&D divisions for Predictive Analytics and Big Data related products.

2. Create a HANA instance.

3. "Hello World" example in Web-based development Workbench.

4. Connect the instance in Eclipse.

5. A sample mobile application built with AngularJS and linked to SAP HANA Trial backend

Next Steps:

6. Create a Java application with HCP

A sample mobile application built with AngularJS and linked to SAP HANA Trial backend


For HCP trial, every developer will have two schemas (DEV_XXX and NEO_XXX) by default. So, NEO_XXX should be your development schema, meanwhile DEV_XXX is the private schema of your developer user. And usually we need to create objects in NEO_XXX schema instead of DEV_XXX [1].


Figure 1


Make sure you've done some basic steps before it. 

I created in the "hanatrial" package for the example and with the same folder structure of the example on Github.
Figure 2

.xsaccess file contains some access control information and .xsapp indicates the application we are building is a xs application of HANA. (File details can be found on Github)


1. Create Models:


  •  Create two tables (people.hdbtable and taxes.hdbtable) and one sequence (peopleseq.hdbsequence). 
    • Use your NEO_*** SCHEMA for table.schemaName. In my case, it will be "NEO_91NN2NENJITDMWTLGL5DD5INO" as displayed in Fig. 3.

1:  table.schemaName = "YOUR SCHEMA STARTS WITH NEO_*** HERE";  
2:  table.tableType = COLUMNSTORE;  
3:  table.columns = [  
4:       {name = "PPSno"; sqlType = VARCHAR; nullable = false; length = 200;},  
5:       {name = "firstName"; sqlType = NVARCHAR; nullable = false;length = 200;},  
6:       {name = "lastName"; sqlType = NVARCHAR; nullable = false; length = 200;},  
7:       {name = "title"; sqlType = NVARCHAR;length = 200;},  
8:       {name = "cellPhone"; sqlType = NVARCHAR;length = 200;},  
9:       {name = "officePhone"; sqlType = NVARCHAR;length = 200;},  
10:       {name = "email"; sqlType = NVARCHAR;length = 200;},  
11:       {name = "city"; sqlType = NVARCHAR;length = 200;},  
12:       {name = "pic"; sqlType = NVARCHAR;length = 200;}];  
13:  table.primaryKey.pkcolumns = ["PPSno"];  

Figure 3
Figure 4


  • Create "init_data" folder and copy files from Gitbub to your folder.
  • Call the procedure to insert data into people and taxes tablestablespoon.
  • Copy all files to the rest folder (Fig. 6), [Run on Server] to check if the data can be accessed (Fig. 7) by your account.


Figure 7
Figure 6
  • Finally, copy all files to your client folder (and change the relative path in these files).

  • Run index.html or iphone.html. You could see the app is running as displayed in Fig 9, 10.

Figure 9

Figure 10

If the page shows insufficient privilege, give the privilege to p**** user account of yours and then try again.

1:  GRANT EXECUTE,select ON schema "NEO_***" TO p***