DBTimes

Home

Products

Frameworks

Contact us

Data Warehouse ETL Configuration v1

Type: object

Defines fields for the Data Warehouse application that uses dw Etl library. The configuration JSON file can have other fields at the top level in addition to dwEtl object.


Configuration for DW Etl process

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: enum (of string)

Must be one of:

  • "LoadDimsFacts"
  • "LoadDims"
Type: object

The following properties are required:

  • dimAuthority
  • dimensions
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: enum (of string)

Must be one of:

  • "LoadDimsFacts"
  • "LoadFacts"
Type: object

The following properties are required:

  • dataMart
  • facts

Type: const

version of DW ETL configuration

Specific value: "1"

Type: boolean

If the value is true, there will be some dataframe related output sent to the standard output from the library causing slowdown in job execution.

Type: enum (of string)

The ETL process consists of two parts – ETL dimensions and ETL facts. jobType is used to run either both or one of these parts. The allowed values for this attribute are "LoadDimsFacts", or "LoadDims", or "LoadFacts". The main scenario for running ETL dimensions separate from ETL facts is loading dimensions in parallel by defining separate configurations for one or more dimensions (using isLoadFlag) and running ETL facts after - serially or in parallel.

Must be one of:

  • "LoadDimsFacts"
  • "LoadDims"
  • "LoadFacts"

Type: boolean

The flag indicates if the load is initial or subsequent. If the load is initial, then the existing files for dimensions and/or facts are deleted. Which ones are deleted depends on the jobType - for "LoadDimsFacts" both dimensions and fact files are deleted, for "LoadDims" - dimensions are deleted, and for "LoadFacts" - fact files are deleted.

There is one use case when this flag should be set to true for ongoing loads: when dimension or fact has to be recreated every time based on current sources, i.e., when rows for non-existent natural keys deleted and all attributes are Type 1.

Type: stringFormat: date-time

The attribute is used to rerun subsequent load for effective dates processed earlier after the timestamp value specified based on the log.

Type: object

When this attribute is defined, the loader will create a file with summary info for each load. The info includes record counts, description of source and destination, and the action timing.

Type: object

File type is parquet for load control.

Type: string

A parquet file path.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

Type: array of object

Staging sources. This are sources for loading dimensions and fact tables.

No Additional Items

Each item of this array must be:

Type: object

Type: string

Staging source moniker is a unique identifier of a staging source. It is used as view name for respective source in Spark SQL.

Type: string

A column in a staging source data that is effective date for the current staging source.

Type: boolean

There can be only one default effective date across all staging sources. When is set to true it designates effective date in current staging source as a default effective date.

Type: string

A column in a staging source data that is has load timestamp. Timestamp can be used for incremental processing of dimension in subsequent ETL runs.

Type: enum (of string)

An attribute to specify how to derive effective date from effectiveDateColumn. The values can be
"DISTINCT" - only the dates in the stg source are used in the etl,
"WEEKDAYS" - all days between min and max values excluding weekends, or
"ALL" - all days between min and max values

Must be one of:

  • "ALL"
  • "DISTINCT"
  • "WEEKDAYS"

Type: object

Defines file staging source.

Type: string

A parquet file path.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

Type: object

A section of specifications for attributes common to all dimensions.

Type: string

Package name is used to dynamically create an instance of a dimension class. All dimension classes described in a configuration must be defined in the same package.

Type: string

A regular expression pattern for dimension name. Each dimension’s name must match this pattern.

Type: object

A section to describe a dimension destination file. The file for each dimension will be created and maintained by the ETL library.

Type: object

File type is parquet for dimension destination.

Type: string

Defines destination file path for all dimensions. The file name in path must contain three underscores as a placeholder for the dimension name

Must match regular expression: ^.*___.*$

Type: string

If defined, DW ETL will preserve a previous version of the dimension and place it in this path. A file name must contain three underscores as a placeholder for the dimension name

Must match regular expression: ^.*___.*$

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

Type: array of object

Describes dimensions. Since dimensions can be loaded in parallel via independent ETL runs this array can have some dimensions absent or inactive (i.e., with 'isLoad' flag set to false)

No Additional Items

Each item of this array must be:

Type: object

Type: string

Name of the dimension. Must match the pattern defined in dimensionNamePattern field.

Type: boolean

If set to false the dimension will not be loaded. Can be used to create separate configurations to load specific dimensions or during development to skip the load of already tested dimensions.

Type: array of string

Monikers of staging sources used to load this dimension. DW ETL will call a loadDim override for each source. If there are no staging sources loadDimm will be called just once.

No Additional Items

Each item of this array must be:

Type: array of object

Other dimensions that are sources for loading this dimension. A dimension that is a source must be loaded prior to loading this dimension.

No Additional Items

Each item of this array must be:

Type: object

Type: string

Name of the dimension.

Type: array of object

Schema lists a subset of columns used to load current dimension (used for optimization to reduce number of columns). If schema is absent all columns can be referenced in loading current dimendion.

No Additional Items

Each item of this array must be:

Type: object

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.


Specifications for dimension columns

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:


Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: true

'scdType' is not applicable for a key column

Must not be:

Type: object

The following properties are required:

  • scdType
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object


'scdType' is not applicable for a Natural Key column

Must not be:

Type: object

The following properties are required:

  • scdType
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: true
Type: object

'isSurrogateKey' and 'unknownValue' are required for a key column

The following properties are required:

  • unknownValue
  • isSurrogateKey
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

'unknownValue' is required for a natural key column

The following properties are required:

  • unknownValue
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: const

'colType' value must be Long if the column is Surrogate key as surrogate key is derived from Spark monotonicallyincreasingid

Specific value: "Long"

Type: string

A name of the dimension column.

Type: enum (of string)

Data type of dimension column. colType must be Short, Integer or Long if the column is a dimension key (i.e., "isKey": true)

Must be one of:

  • "Short"
  • "Integer"
  • "Long"
  • "Date"
  • "Timestamp"
  • "String"
  • "Double"

Type: boolean

If true, this column is a dimension key.

Type: boolean

isSurrogateKey can only be defined for dimension key column, i.e., when "isKey": true. If true, this column is a surrogate key and its value will be generated using increasing – but not necessarily sequential - distinct values. The data type for a surrogate key must be “Long”.
If isSurrogateKey is false or not defined, the value for the key column must be provided together with the rest of the dimension values.

Type: string or null

Unknown value must be the valid value for column data type. Use yyyy-mm-dd format for Date type. If unknown value is not specified it will be set to NULL to any column but the dimension key – the default unknown value for dimension key is 0 (zero).

Type: boolean

A flag to indicate that a column is a natural key for the dimension. Multiple columns can be defined as natural key to create a compound natural key.

Type: enum (of integer)

Slowly changing dimension column modeling technique: 0 - Retain Original Non-Null Value, 1 - Overwrite, 2 - Add New Row, 3 - Retain Latest Non-Null Value. Default - 1

Must be one of:

  • 0
  • 1
  • 2
  • 3

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

Type: object

A section of specifications for attributes common to all fact tables.

Type: string

All fact classes described in a configuration must be defined in the same package. Package name is used to dynamically create an instance of a fact class.

Type: string

A regular expression pattern for fact table name. Each fact table’s name must match this pattern.

Type: object

A section to describe a fact table destination file. The file for each fact table will be created and maintained by the ETL library.

Type: object

File type is parquet for fact table destination.

Type: string

Defines destination file path for all fact tables. For example, "path" : "/dw/data/dm/FactNamePlaceholder.parquet". Text FactNamePlaceholder in path must match the factNamePattern above. Text 'FactNamePlaceholder' will be replaced with actual fact table name which also has to match the pattern.

Must match regular expression: ^.*___.*$

Type: string

If defined, DW ETL will create fact table with natural keys used to set fact table keys in addition to regulat fact table. This file is used mostly in development to insure the correct setting on dimension keys on a fact table and troubleshoot the unknown keys. The help in troubleshooting the unknown keys can make this file useful in production. Creating of this file has relatively low performance cost.

Must match regular expression: ^.*___.*$

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

Type: array of object

Specifications for fact tables or facts (fact table and fact are used interchangeably). Since facts can be loaded in parallel via independent ETL runs this array can have some facta absent or inactive (i.e., with 'isLoad' flag set to false)

No Additional Items

Each item of this array must be:

Type: object

Type: string

The name of the fact table. The name must match the pattern defined in factNamePattern attribute.

Type: boolean

If set to false the dimension will not be loaded. Set it to false during development to skip loading of some fact table. Can also be used in production to create different configurations to load fact tables in parallel.

Type: enum (of string)

The following fact processing modes are supported on subsequent ETL runs:
• REPLACE – new fact table replaces the old one. Fact table can have partition columns (one or more), i.e., columns with isForPartition flag set to true. If partition columns are defined the fact table will be replaced and partitioned.
• REPLACEPARTITION – this mode is similar to REPLACE, but requires to have partition columns. In this mode new partitions replace old partitions with the same name, but if new partition does not exist for some existing old partitions – the old partitions will remain.
• MERGE – old fact table rows are merged with new based on the merge key columns. All rows in old fact table with the same merge key are replaced with new ones. The old rows with merge keys that do not exist in the new fact table will remain.
• MERGE
PARTITION – this mode is similar to MERGE, only in addition to merge key takes partition column into consideration.
• ADD – new rows are added to existing ones. Fact table can have one or more partition columns. If partition columns are defined the new rows are added to respective partitions.

Must be one of:

  • "REPLACE"
  • "REPLACE_PARTITION"
  • "MERGE"
  • "MERGE_PARTITION"
  • "ADD"

Type: array of string

Monikers of staging sources used to load this fact table. DW ETL will call a loadFact override for each source. If there are no staging sources loadFact will be called just once.

No Additional Items

Each item of this array must be:

Type: array of object

Other dimensions that are used to load this fact table. This dimensions must be distingushed from dimentions used to set key. The dimension needs to be listed here is it used to load fact values as opposed to setting keys. Dimensions to set keys are defined in schema.

No Additional Items

Each item of this array must be:

Type: object

Type: string

Name of the dimension.

Type: array of object

Specifications for dimension columns used in loading fact table

No Additional Items

Each item of this array must be:

Type: object

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

Type: array of object

Specifications for fact columns.
The fact table is constructed from schema using following rule:
• If "isForPartition" column or columns are defined the fact table will be partioned on this columns using Spark partitioning feature.
• Distinct "foreignKey" values will be used to create fact table foreign keys. If multiple columns are needed to set a foreign key, the schema would have multiple elements with the same value of a foreign key – one for each column needed to asset a key. For example, if there are two columns from the underlying dimension are needed to set a key, the fact table schema will have two elements with the same value of "foreignKey".
• Columns with "isMeasure" attribute set will be added to a fact table as measures

No Additional Items

Each item of this array must be:


Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

The following properties are required:

  • isForSettingForeignKey
Type: object

If this attribute of a column is set to true, there should be three more properties defined: foreignKey, underlyingDim, and underlyingDimCol. The underlyingDimCol is optional.

The following properties are required:

  • foreignKey
  • underlyingDim
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: true
Type: object

Type: enum (of string)

Must be one of:

  • "Double"
  • "Short"
  • "Integer"
  • "Long"

Type: string

Name of the column for the result of select in loadFact method. This will be the name of the column for measures (i.e., when "isMeasure": true), but will not be a name of the foreign key column. See "foreignKey" attribute for names of the foreign keys

Type: enum (of string)

Type of the column whose name is defined in "colName". A data type of a measure column must be Double, Short, Integer or Long. The type of foreign keys is determined by the type of the respective key on the underlying dimension

Must be one of:

  • "Short"
  • "Integer"
  • "Long"
  • "Date"
  • "Timestamp"
  • "String"
  • "Double"

Type: boolean

A flag to indicate that this column is used for partitioning fact data. For example, for column { "colName" : "SeasonYear", "colType" : "Integer", "isForPartition" : true } the fact directory structure would look like below

FactPlays.parquet
SeasonYear=2013
SeasonYear=2014
SeasonYear=2015
SeasonYear=2016
SeasonYear=2017

To query partitioned Fact tables in, for example Apache Drill, use syntax like this

select * from dfs.fact-file-path/FactPlay.parquet where dir0=’SeasonYear=2016’

Type: boolean

A flag to indicate that the column is used for merge of fact data during subsequent loads. All fact table records that have a merge key value that is present in a new fact table will be deleted and replaced with new values

Type: boolean

This flag can be set on a column of Date type to designate a column as an effective date for a dimension with scd type 2 columns. The column will be used to set the key of dimension via equation: eff-date-for-type-two-column between dimension-row-start-date and dimension-row-end-date. Only one column in fact table schema can have this attribute set to true

Type: boolean

When isForSettingForeignKey is set, this column is used to set a foreign key from a dimension on a fact row. The column is either a part of natural dimension key or some other column in a dimension that is used in a custom logic to set a foreign dimension key.
If this attribute of a column is set to true, there should be three more properties defined: foreignKey, underlyingDim, and underlyingDimCol. The underlyingDimCol is optional.

For example, if some dimension has three natural key columns that comprise a unique compound key, in the schema there would be three columns - one for each natural key – to set one foreign key on the resulting fact table.

If underlyingDimCol is not defined the setForeignKeyOnFactTable method must be overridden to implement custom logic for setting the foreign key on the fact table

Type: string

The name of the foreign key column on the fact table. If the foreign key is set using multiple fields (compound key) from the underlying dimension, there will be multiple schema elements with the same "foreignKey" value. There will be only one column with that name in the fact table

Type: string

The name of the dimension with the primary key for the the given "foreignKey"

Type: string

The name of the column in the underlying dimension that is used to set given "foreignKey". If all underlying dimension columns have isNaturalKey set to true, the default implementation of setForeignKeyOnFactTable will be used, otherwise this method will have to be overridden in the corresponding dimension class.

Type: boolean

This flag designates a column as a fact table measure (or fact). The measure column must be one of the numeric types – Float, Short, Integer, or Long.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.

All properties whose name matches the following regular expression must respect the following conditions

Property name regular expression: ^__
Type: string, number, integer, boolean, object, array or null

Comment field begins with two underscores. There can be any number of comment fields.