This tutorial is a “quick and dirty” guide to creating and accessing HANA data from within Vora Tools using HANA virtual tables.
SAP Vora 1.4
SAP HANA Platform 2.0
For more information on minimum prerequisites see the SAP Note Prerequisites for Installing Vora
This tutorial assumes you have a working SAP Vora 1.4 installation as well as a functional and working HANA Platform database running. These can be on separate systems but must be networked.
In order to create a virtual table in Vora from a HANA table, we must know the following about the HANA table:
- table name
- database schema (the name of the catalog where the table resides)
- server hostname
- instance number
- user and password (with table access)
As an example, here is a test table in HANA Studio I will be using:
Data preview of the table:
We can see the table HANA_TEST resides under the SYSTEM catalog and is accessible by SYSTEM user.
Virtual tables are created using the SAP HANA data source package that is built-in to Vora:
We need to add this to a USING statement to specify to Vora which data source we want to use
The syntax will look like this:
CREATE TABLE <tablename> USING com.sap.spark.hana OPTIONS ( tablepath "<table_name>", dbschema "<catalog_name>", host "<hostname>", instance "<instance_num>", user "<username>", passwd "<password>" );
For my test table, my query will look similar to below:
CREATE TABLE HANATEST USING com.sap.spark.hana OPTIONS ( tablepath "HANA_TEST", dbschema "SYSTEM", host "myhost.mydomain.com", instance "00", user "SYSTEM", passwd "mypass123" );
The table schema should automatically be picked up via the dbschema option. You can alternatively specify this with an additional schema option.
... schema "name varchar(200), age integer", ...
Once the create table statement is run in Vora Tools, the new table should be visible in the Data Browser tab under the HANA engine:
A data preview of the table shows the same information we see in HANA Studio:
This is a very basic quick start guide for creating virtual HANA table from within Vora Tools.
For a more in-depth description of options and more advanced use-cases, see the Vora Developers Guide section “Accessing Data in SAP HANA”