Skip to content

Columns

Bruin supports column definitions inside assets to make them a part of your data pipelines:

  • you can document the existing columns in an asset and add further metadata, e.g. primary_key
  • you can define column-level quality checks
  • you can define whether or not a column should be updated as a result of a merge materialization

Definition Schema

The top level columns key is where you can define your columns. This is a list that contains all the columns defined with the asset, along with their quality checks and other metadata.

Here's an example column definition:

yaml
columns:
  - name: col1
    type: integer
    description: "Just a number"
    primary_key: true
    checks:
      - name: unique
      - name: not_null
      - name: positive
  - name: col2
    type: string
    description: |
      some multi-line definition for this column
    update_on_merge: true
    checks:
      - name: not_null
      - name: accepted_values
        value: [ 'value1', 'value2' ]

Each column will have the following keys:

keytypereq?description
nameStringyesThe name of the column
typeStringnoThe column type in the DB
descriptionStringnoThe description for the column
primary_keyBoolnoWhether the column is a primary key
update_on_mergeBoolnoWhether the column should be updated with merge
checksCheck[]noThe quality checks defined for the column

Quality Checks

The structure of the quality checks is rather simple:

keytypereq?description
nameStringyesThe name of the quality check, see Quality
blockingBoolnoWhether the check should block the downstreams, default true
valueAnynoCheck-specific expected value
For more details on the quality checks, please refer to the Quality documentation.