Prepare Your HDI Project for Exchanging Data with Your Space
To allow your SAP Datasphere space to read from and, if appropriate, write to the HDI container, you must configure your HDI project to build on your SAP Datasphere tenant and define the appropriate roles.
Prerequisites
-
To allow you to add a container to your space and allow you to exchange data between the container and the space, you must define the roles DWC_CONSUMPTION_ROLE and DWC_CONSUMPTION_ROLE# (with grant option) in the container.
The contents of the roles define the HDI objects that can be read from or written to. You can allow access to individual objects or to all the objects in the container.
These examples show roles that provide read access to individual objects or to all objects in the container:Read Access to Individual Objects
Read Access to the Schema
This example provides read access to one table and one view in the container:
{ "role": { "name": "DWC_CONSUMPTION_ROLE", "object_privileges": [ { "name":"MyNamespace::Table1", "type":"TABLE", "privileges":[ "SELECT" ] }, { "name":"MyNamespace::CalcView1", "type":"VIEW", "privileges":[ "SELECT" ] } ] } }This example provides read access to all the objects in the container:
{ "role": { "name": "DWC_CONSUMPTION_ROLE", "schema_privileges": [ { "privileges":[ "SELECT" ] } ] } }To allow the tables of an HDI container to be replicated as part of an elastic compute node process, do as follows:{ "role": { "name": "DWC_CONSUMPTION_ROLE", "schema_privileges": [ { "privileges":[ "SELECT", "ALTER", "UPDATE" ] } ] } }Note that not all types of tables can set to be replicated (see Table Replication Limitations in the SAP HANA Administration Guide for SAP HANA Platform documentation). For more information about elastic compute nodes, see Create an Elastic Compute Node. -
To allow data flows in your space to write to the container you must, in addition, define the roles DWC_WRITE_ROLE and DWC_WRITE_ROLE#.
These examples show roles that provide write access to individual objects or to all objects in the container:Write Access to Individual Objects
Write Access to the Schema
This example provides write access to two tables in the container:
{ "role": { "name": "DWC_WRITE_ROLE", "object_privileges": [ { "name":"MyNamespace::Table1", "type":"TABLE", "privileges":[ "SELECT", "INSERT", "UPDATE", "DELETE" ] }, { "name":"MyNamespace::Table2", "type":"TABLE", "privileges":[ "SELECT" ] } ] } }This example provides write access to all the objects in the container:
{ "role": { "name": "DWC_WRITE_ROLE", "schema_privileges": [ { "privileges":[ "SELECT", "INSERT", "UPDATE", "DELETE" ] } ] } }For detailed information about hdbroles, see Roles (.hdbrole and .hdbroleconfig) in the SAP HANA Platform documentation.