SAP HANA Cloud provides templates for different types of projects. In the context of modeling, we usually use the template for an SAP HANA Database Project.
Use the template wizard to create your project. During the creation steps, you'll be prompted to choose various settings. HDB module can define a local persistence (a persistence layer that is defined and deployed in the application itself). When you build a virtual data model based on calculation views – even if the source data is stored outside of the application – the HDB module contains the database artifacts that define this virtual data model.
When you create a new HDB module, you must provide a number of properties for the module. Most of these properties are stored in the descriptor file of the application: (mta.yaml), except for a few. In particular, the namespace property of the module isn't stored in the descriptor file but is materialized by the .hdinamespace file located in the src folder.
Key Settings of an HDB Module
Setting | Description | Example |
---|---|---|
Project Name | The name of the project | sales_analytics_project |
Module Name | The name of the module. It should be unique within the entire descriptor file (mta.yaml). | core-database-module |
Type | hdb is the reserved module type for an HDB module. | hdb |
Path | The relative location of the module root within the file structure of the project. | db |
Namespace | Optional: this will be the prefix to all generated object names | sales |
Schema Name | Optional: Choose a specific name for the HDI container schema used for deployment. See below for more details. | SAMPLE_SCHEMA |
SAP HANA Database Version | SAP HANA Service (legacy service in SAP BTP) or HANA Cloud. |
Default Schema Name of the HDB Module Container
During the creation of an HDB module, specifying a schema name is optional.
If you don't specify a schema name, it's generated during the deployment of a project with the following name structure:
1<project_name>_<hdi_service_name_in_MTA>_<numeric_increment>
For example: MYPROJECT_HDI_DB_1
To identify the name of the generated database schema, open an SQL console connected to the container and execute the following SQL query:
1select CURRENT_SCHEMA from DUMMY;
Specifying a Schema Name for the HDI Container
If you prefer not to have the schema name generated and would like to use a specific schema name, this is possible. This is done in the descriptor file mta.yaml of your project, and more specifically in the parameters of the hdi-container service that is defined as a resource used by the HDB module.
The following sample shows the additional parameters section of the mta.yaml file where the schema name is defined:
12345678resources:
- name: hdi-cont
parameters:
config:
schema: <YOUR_SCHEMA_NAME>
properties:
hdi-container-name: ${service-name}
type: com.sap.xs.hdi-container
Then, the schema generated during the first build of the HDB module is named as follows:
1<YOUR_SCHEMA_NAME>_<numeric_increment>
Caution
Although it's possible to force the schema name to be exactly what you specify in the mta.yaml file, by adding a parameter in the config section, this can generate schema naming conflicts in case several projects use the same schema name, so is usually not recommended, and you should allow the schema name to be generates automatically as a unique value.