DBTimes

Home

Products

Frameworks

Contact us

Source Loader Configuration

Type: object

Defines the required field for the source loader application that uses the DW Source Loader library. The application configuration can have other root-level fields.

Type: object

Configuration for Source Loader

Type: array of object

Specifications for loading files or database tables into staging files. A load action is used to load one database table or one file. A single load action can also be used to load multiple files if their names follow the same pattern, with a date as the variable part.

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: object

If the destination file is defined with "isVersioned"=true, then the schema must be defined with at least one column as a primary key, i.e., "isUniqueKey": true.

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

If incrementalLoad is defined, then the destination must be versioned, i.e., with "isVersioned"=true.

Type: object

The following properties are required:

  • incrementalLoad
Type: object

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

If any column in the schema defines "formats", the load action must be a csv file source.

Type: object

Type: object

The following properties are required:

  • csv

Type: object


Type: object

Type: object

Type: string

A regular expression for the file names to process. The files can have an effective date as part of the name. In that case, the files are processed in ascending date order.

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

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.

Type: object

Type: object

This attribute must be defined when a user function is used to provide the path of the file to be loaded. The user function must be implemented as a Scala object or Java static method. The method must take one parameter of type Option[Config] and return a String with the file path or file content (depending on the "methodReturns" value, "FilePath" or "FileData"), e.g.,

def sampleForCsvFileCustomLocation( params: Option[Config] ): String = {
s"/some-path/csv-file.csv"
}

Type: enum (of string)

The type of data that the method returns: FilePath - the path of the file, FileData - a string with the file content.

Must be one of:

  • "FilePath"
  • "FileData"

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

Specifies that the file being loaded is a .csv file. This object can optionally specify any valid Spark read options for loading a csv file.

Example of a configuration with no options:
"csv" : { }

Example of a configuration with some options:
"csv" :
{
"mode" : "PERMISSIVE",
"header" : true,
"encoding" : "ISO-8859-1"
}
Properties for a csv file can be any of the options for Spark csv file processing. The "schema" array must be defined if inferSchema is not set to true.

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


Type: object

JDBC Options

Type: object

Defines SQL Server as the source DBMS. The fields in the sqlServer object can be any valid fields defined by the Spark specification for a JDBC database source – see https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html.
For example,
"url" : "jdbc:sqlserver://my-server\SQLSERVER2019:1433;database=my-db-name;integratedSecurity=true;".

If "numPartitions" is defined then one of the columns in "schema" must have the "isPartitionColumn" attribute set to true. The "lowerBound" and "upperBound" are optional; if absent, they will be determined by the loader by querying the source table.

Must not be:

Type: object

"partitionColumn" is excluded from the list of options for the JDBC source, since this column has to be defined in "schema" with the "isPartitionColumn" flag.

The following properties are required:

  • partitionColumn


When the load action defines an incremental load, this attribute, if used, should have a statement that loads data incrementally based on a watermark column or columns. A watermark column is a column whose previously loaded MAX value is used to determine the new rows for the incremental load.


When the load action defines an incremental load, this attribute, if used, should have a statement that loads data incrementally based on a watermark column or columns. A watermark column is a column whose previously loaded MAX value is used to determine the new rows for the incremental load.

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

JDBC Options

Type: object

Defines Oracle as the source DBMS. The fields inside the oracle object can be any valid fields defined by the Spark specification for a JDBC database source – see https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html
For example,
"url" : "jdbc:oracle:thin@//host-name:port/service-name"
.

Same definition as sqlServer

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

Type: object

Properties for dbmsSource mongoDb can be any of the options supported by the MongoDB Spark connector in batch mode. The schema must be defined.


When the load action defines an incremental load, this attribute, if used, should have a statement that loads data incrementally based on a watermark column or columns. A watermark column is a column whose previously loaded MAX value is used to determine the new rows for the incremental load.

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

Incremental load defines loading of newly added or changed data from the source. The incremental load uses a field designated as the watermark column. The watermark column can be any value that grows when a row is inserted or updated, e.g., a row update timestamp or, in the case of SQL Server, a ROWVERSION column. The loader determines the MAX value for the watermark column in the current data and injects it into the query to allow selection of data rows that were added or changed since the last load.


Unique keys are needed to delete records from the destination file for keys that are no longer in the source. If unique keys are not defined, they will be generated programmatically.

Type: string

Watermark columns are the columns in the destination file that are used in an incremental load. The query to get data incrementally uses the current MAX value of the watermark column to get new records whose watermark column value is greater than the one already in the destination file. The delimiter designates a column in the query as a watermark column. For example, with three colons as the delimiter, the query for incremental load may look like this: SELECT OrderNumber, OrderTime From Orders WHERE OrderTime > :::OrderTime:::

Must match regular expression: ^[:@#!-]+$

Must be at most 5 characters 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.

Type: string

The name of the load action, used to differentiate multiple load actions. It must be unique within the configuration.

Type: boolean

If the value of isActive is false, the load action will not be processed.

Type: boolean

If the value is true, the library will send some dataframe-related output to standard output, which slows down job execution.

Type: object

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

Type: object

The file type for load control is Parquet.

Type: string

A directory with the load control file.

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

Type: boolean

When the value of isVersioned is true, the loader will maintain a versioned destination file. A new version of the row is inserted, based on the unique key, when any of the field values change. The unique key can be a single column or multiple columns (compound key). The granularity of versioning is a calendar day defined by the effective date. If a source has a date field designated as the effective date, its value will be used to create versions. In the absence of such a field, the loader will use the current date.

When isVersioned is set to false, the loader will maintain a non-versioned destination file. A non-versioned file saves the data for every effective date in full.

Type: string

Metadata columns are the columns with reserved names that serve special functions. If the name of a metadata column collides with a data column name, use the metadata columns prefix to differentiate the names.

Must match regular expression: ^[A-Za-z_][A-Za-z0-9_]*$

Type: object

Defines Parquet as the type of the destination file.

Type: string

Full path of the destination file.

Type: string

If defined, the Source Loader will save a copy of the current file under this name. This can be useful for going back to the previous version of the file if needed.

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

The schema defines the structure of the destination file. The schema can be absent for a DBMS source. It can also be absent for a file source if the "inferSchema" option is set to true.

If fileDestination.isVersioned is set to true, the schema must have one or more columns with the isUniqueKey attribute set to true.

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

If "isPartitionColumn" attribute of a column is set to true, colType must be defined (it is needed to determine the type of upper and lower bounds).

The following properties are required:

  • colType
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:

  • formats
Type: object

"formats" is only allowed for columns of type Timestamp or Date, so "colType" must be defined and be one of them.

Type: object
Must match regular expression: ^([Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp]|[Dd][Aa][Tt][Ee])$

Type: boolean

Designates a column as a unique key. This column attribute cannot be derived from the DBMS, so to designate a column as a unique key, the column has to be included in the schema.

Multiple columns can be designated as unique keys to create a composite unique key.

The unique key is used for incremental load from DBMS sources or for creating a versioned destination file.

Type: boolean

For a DBMS source, one column can be defined as the partition column to read data on multiple connections in parallel. isPartitionColumn must be defined if numPartitions is defined.

Type: boolean

This field is used for a versioned destination file. When this flag is set to true, a change to the field in the source will not trigger the creation of a new version of the row.

Type: array of string

Allowed formats for a Timestamp or Date column when loaded from a csv file. Requires colType to be Timestamp or Date.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Type: object

Definition of the allowed changes to the data schema on consecutive loads, for both versioned and non-versioned data.

Type: boolean

If true, the "metadataColumnsPrefix" value can change on consecutive loads.

Type: object

Type: boolean

When the value of isAllow is true, the data on consecutive loads can have new columns.

Type: array of object

The columns allowed to be added, with an optional value to populate previously loaded data. If this element is absent or empty and adding columns is allowed, any column can be added.

No Additional Items

Each item of this array must be:

Type: object

Type: string

A pattern for the names of columns allowed to be added.

Type: string, number, integer or boolean

The value for previously loaded data. The type should match the type of the column. If the value is omitted, it defaults to a value based on the column type, and if that is not defined, to null.

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: string

The value used to populate previously loaded data for new columns of string type. If a backfill value is defined for a specific column, it will take precedence over this value.

Type: number

The value used to populate previously loaded data for new columns of float or double type. If a backfill value is defined for a specific column, it will take precedence over this value.

Type: integer

The value used to populate previously loaded data for new columns of integer type. If a backfill value is defined for a specific column, it will take precedence over this value.

Type: boolean

The value used to populate previously loaded data for new columns of boolean type. If a backfill value is defined for a specific column, it will take precedence over this value.

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

Type: boolean

When the value of isAllow is true, the data on consecutive loads can have omitted columns that will be deleted from previously loaded data.

Type: array of string

The name pattern for columns to be deleted. If this element is absent or empty and column deletion is allowed, any column can be deleted.

No Additional Items

Each item of this array must be:

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

Type: boolean

When the value of isAllow is true, the column data type can be changed to that of new data.

Type: array of string

The name pattern for columns whose type is allowed to change. If this element is absent or empty and column type change is allowed, any column's type can be changed.

No Additional Items

Each item of this array must be:

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

Type: array of object

Staging sources that are used for post-processing the current staging source. These sources will be preloaded and made available as views in the post-process method.

No Additional Items

Each item of this array must be:

Type: object

Type: string

The staging source id is a unique identifier of a staging source. It is used as the view name in Spark SQL.

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.

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.