WhereScape 3D Model Conversions: Assigning a schema

This blog is part of series about Wherescape 3D.
See the overview blog post: The power of model conversions in data warehouse automation

When you assign a schema in WhereScape 3D you typically have to manually type the name of the schema to be assigned. There is no direct built-in function to assign a template to script the name of the schema.

assigning a schema
Screenshot: Assigning a schema with the help of a conversion rule

What you can influence though is to match your entity to your manual schema name.
Firstly, use the following condition to restrict the matching entities:

Matching condition for entities
Screenshot: Custom entity template

Secondly, write a entity template to match (i.e. your model name).

Custom entity template to match entity
Screenshot: Custom entity template
{%- if table.ModelVersion.name == "Demo" -%}
    {{-  true -}}
{%- endif -%}

These 3 lines of pebble code evaluate the name of your model. Therefore the function will return true if the name of your model matches the condition „Demo“. Basically, that’s all there is to it! When you run a model conversion with this conversion rule, every entity in the model Demo will be assigned to the Demo schema.

The schema is assigned automatically by the conversion rule
Screenshot: schema assigned automatically by conversion rule

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert