Datasets reference

A datasets defines a table or view that will be created in your data warehouse.

For examples and usage, check out the datasets guide.

ref()

Returns the full, query-able name of the referenced dataset, and adds the dataset to dependencies.

ref(tableName)

Arguments

FieldTypeDescription
tableNamestringThe name of the dataset to reference

self()

Returns the full, query-able name of the current dataset

self()

dependencies()

Specifies one or more datasets, operations or assertions that this action depends on. Supports wildcard matches with "*".

dependencies(deps)

Arguments

FieldTypeDescription
depsstring | string[]Either a single dependency name, or a list

type()

Set the type of the dataset. View the table guide for more info.

type(name)

Arguments

FieldTypeDescription
name"view" | "table" | "incremental" | "inline"The type of the dataset

where()

Sets a where clause that is used for incremental datasets.

where(clause)

Arguments

FieldTypeDescription
clauseContextable<string>The where clause. Can be a string or a context function.

protected()

A incremental dataset marked protected will never be rebuilt from scratch.

protected()

disabled()

Disable this action from being run.

disabled()

preOps()

Provide one of more queries to execute before this dataset is created.

preOps(ops)

Arguments

FieldTypeDescription
opsContextable<string | string[]>The queries to run

postOps()

Provide one of more queries to execute after this dataset has completed.

postOps(ops)

Arguments

FieldTypeDescription
opsContextable<string | string[]>The queries to run

describe()

Adds a field to the dataset descriptor with the given description (optional), and returns the field name.

describe(field, description?)

Arguments

FieldTypeDescription
fieldstringThe field name
descriptionstringThe field description

descriptor()

Sets the descriptor for fields in this dataset.

descriptor(fields)
descriptor(field, description)
descriptor(descriptor)

Arguments

FieldTypeDescription
fieldsstring[]A list of field names
fieldstringThe field name
descriptionstringThe field description
descriptor{[field: string]: string}A map of field names to field descriptions

config()

Sets several properties of the dataset at once.

config(config)

Arguments

FieldTypeDescription
configTableConfigThe configuration object