Every active SAP® HANA Information Model (Attribute views, Analytic views, Calculation views) is saved in the standard table: _SYS_REPO.ACTIVE_OBJECT, in the form of XML code.
The columns of the table are the following:
Name | SQL Data Type | Dimension | Column Store Data Type | Key | Not Null | Default | Comment |
---|---|---|---|---|---|---|---|
PACKAGE_ID | NVARCHAR | 256 | STRING | X(1) | X | ||
OBJECT_NAME | NVARCHAR | 256 | STRING | X(2) | X | ||
OBJECT_SUFFIX | NVARCHAR | 255 | STRING | X(3) | X | ||
VERSION_ID | INTEGER | INT | X | ||||
ACTIVATED_AT | TIMESTAMP | LONGDATE | X | ||||
ACTIVATED_BY | NVARCHAR | 256 | STRING | X | |||
EDIT | TINYINT | INT | X | 1 | |||
CDATA | NCLOB | 2147483647 | LOB | XML version of the saved object | |||
BDATA | BLOB | LOB | |||||
COMPRESSION_TYPE | INTEGER | INT | |||||
FORMAT_VERSION | NVARCHAR | 16 | STRING | ||||
DELIVERY_UNIT | NVARCHAR | 256 | STRING | ||||
DU_VERSION | NVARCHAR | 256 | STRING | ||||
DU_VENDOR | NVARCHAR | 256 | STRING | ||||
DU_VERSION_SP | NVARCHAR | 16 | STRING | ||||
DU_VERSION_PATCH | NVARCHAR | 16 | STRING | ||||
OBJECT_STATUS | TINYINT | INT | X | 0 | |||
CHANGE_NUMBER | INTEGER | INT | 0 | ||||
RELEASED_AT | TIMESTAMP | LONGDATE |
The XML presentation of the information model is saved in the column: CDATA, and the main structure of the XML code, depending on the model itself, can be the following:
<?xml version="1.0" encoding="UTF-8"?> <Calculation:scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...> <origin/> <descriptions defaultDescription="Description"/> <metadata changedAt="2020-05-20 23:58:10.531"/> <localVariables> ... </localVariables> <variableMappings> ... </variableMappings> <informationModelLayout relativeWidthScenario="61"/> <dataSources> ... </dataSources> <calculationViews> ... </calculationViews> <logicalModel id="Logical_model_ID"> ... </logicalModel> <layout> ... </layout> </Calculation:scenario>
The XML structure is sorted the way that the input of the model is presented in the lower part of the XML where the top part of the XML contains the data sources of the model.
The logic of the XML nodes is the following:
Calculation views model
Calculation:scenario
The top node consists of the main information about the model such as the version and so on.
Logical Model
The logical model node is the main entrance XML node, where all the fields available in the information model are presented. The main types of the field are presented with its own XML nodes:
- Simple attribute
<attributes> - Calculated attribute
<calculatedAttributes> - Simple measure
<baseMeasures> - Calculated measure
<calculatedMeasures>
Based on the field type the link to the next object in the model is shared. For example, in the case of an attribute, it can be its key mapping to the Calculation View node.
Calculation Views
The Calculation Views node consists of Calculation views and its fields.
Calculation View
Every Calculation View node has a similar structure as the Logical Model node and can contain simple mapping or for example field’s specific calculation. The mapping to another object is presented within the Input node.
Data Sources
The Data Sources node contains the mapping between the fields of the current model (the last object – calculation view) and another model, table, or in general another source.
Local variables
The Local Variable node consists of the input variables presented in the model.