Extending catalog files

Count catalog files (views and datasets) can extend other files using the extends property. Both Count YAML files and third-party catalog files (e.g. LookML files) can be extended.

Extending view/dataset files allows you to reuse shared configuration for multiple views/datasets without needing to duplicate this configuration.

For example, you might have a single database table (e.g. users) which makes sense to expose as two different views for the two different ways that it is joined with other tables (e.g. customers in the context of the orders table or reviewers in the context of the reviews table). In this case, you may have a users view which isn't actually used in any datasets and two views that extend this users view: customers and reviewers (reusing the source and many of the fields). Maybe only the view names, label, and description are overwritten or maybe some fields are omitted, given new labels/descriptions, or additional fields are added.

Extending a View

Loading code...

Extending a Dataset

Loading code...

How Extension Works

  • Properties from the base file are merged into the extending file. The extending file's properties take priority.
  • Arrays (fields, joins) are merged by identifier (name for fields, view for joins). Items present in both files use the extending file's values, with gaps filled from the base.
  • Extension chains are supported (A extends B extends C).
  • The omit_fields, omit_joins (for views) and omit_views, omit_joins (for datasets) options allow selectively excluding items inherited from the base.
  • For example while extending a view, it's possible to add additional fields, omit fields from the base view, and override field properties (e.g. the label or expression of the field).

Extendable File Types

  • .view.yml can extend: .view.yml, .view.lkml
  • .dataset.yml can extend: .dataset.yml, .explore.lkml, .model.lkml