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
|The name of the project
|The name of the module. It should be unique within the entire descriptor file (mta.yaml).
hdb is the reserved module type for an HDB module.
|The relative location of the module root within the file structure of the project.
|Optional: this will be the prefix to all generated object names
|Optional: Choose a specific name for the HDI container schema used for deployment. See below for more details.
|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:
To identify the name of the generated database schema, open an SQL console connected to the container and execute the following SQL query:
select 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:
- name: hdi-cont
Then, the schema generated during the first build of the HDB module is named as follows:
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.