In this last step of this series, we'll show you how to test out SDI to load data from a file into HANA on HCP. Make sure you have finished the setup of the SDI agent in the previous steps. Once you've tested out this simple scenario, you can go back to the parent blog for links to resources to learn more about SDI: Smart Data Integration available for HCP
For this demo we will use a very simple file (data.csv) which looks like this:
FirstName,LastName,Country
Eden,Hazard,Belgium
Lionel,Messi,Argentina
Cristiano,Ronaldo,Portugal
In order for the SDI data provisioning agent to read this file, you will need a configuration file that describes this file. You can check the documentation on the SDI file adapter ( File - Administration Guide for SAP HANA Smart Data Integration and SAP HANA Smart Data Quality - SA... ) for more details on how to (automatically) create such a file, but a simple configuration file (data.cfg) for the data file above would be:
Fileformat to read sample data
FORMAT=CSV
FORCE_FILENAME_PATTERN=data%.csv
COLUMN_DELIMITER=,
ROW_DELIMITER=\r\n
SKIP_HEADER_LINES=1
COLUMN=FIRSTNAME;VARCHAR(50);First Name
COLUMN=LASTNAME;VARCHAR(50);Last name
COLUMN=COUNTRY;VARCHAR(50);Country
Note: the value (filename) you use for FORCE_FILENAME_PATTERN is case sensitive. So make sure your file name matches exactly. A wildcard (%) can be used to select multiple files that match the pattern.
We assume you have the configuration file (data.cfg) in a directory D:\Data\Config and the data file (data.csv) in D:\Data\Data.
In order to read these files, you need to configure the file adapter in the data provisioning agent. This is done through the configuration tool which we used to configure and connect the agent. First we need to set some properties for the file adapter:
Back on the main screen in the configuration tool, you can select the FileAdapter in the list of adapters and click "Register Adapter". Once this is completed, the file adapter on this agent will be visible in the HANA Web IDE to create your remote source.
So log in to the HANA WebIDE now (use the SDI_USER to make sure you have the required authorizations as set up in step 4) and open the Catalog editor (https://<your HANA server>.hana.ondemand.com/sap/hana/ide/catalog). Go the the "Provisioning" folder and create a "New Remote Source".
Complete the required fields to define the remote source:
Once you save the remote source, the connection will be tested, you should see a "Remote Source saved successfully" message.
Now you can browse the remote source by expanding the Files remote source in the browser and should see several tables. There are some default tables with technical metadata like CODEPAGES, FILECONTENT, ... etc. But you will also see the "Data" table which corresponds to the Data.cfg file format we created earlier. Each cfg file format will result in an additional entry in this list.
In order to access the data in the file, we can now create a virtual table by right clicking on the "Data" entry and select "New Virtual Table". Provide a name for the virtual table and the schema to create it in.
Finally you can go to the Catalog, browse to your schema and should see the newly created virtual table. You can run SQL against this table now, or just open the content in the Web IDE. Once you see the data you have successfully proofed the agent is able to connect to onPremise sources and send the data to HANA on HCP.
This concludes this blog series. Next you can continue your learning by really replicating the data via a replication task, so that you can schedule regular data loads, you can explore flowgrpahs to add additional transformation steps before storing the data and of course look into more exiting adapters like the (real-time) database adapters, Twitter, Odata, ... etc. You will find links to more resources to continue your learning on the main page of this blog series: Smart Data Integration available for HCP.
Have fun !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
24 | |
21 | |
13 | |
9 | |
9 | |
9 | |
9 | |
8 | |
8 |