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 and Snowflake 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
# customers.view.yml
name: customers
extends:
path: users.view.yml # Path to base file
omit_fields: # Optional: exclude specific fields from base
- last_signed_in
# Properties defined here override base properties.
label: Customers
description: Users linked to orders
# Fields defined here override base fields with the same name.
# Base fields not listed in omit_fields are inherited.
fields:
- name: full_name
label: Customer nameExtending a Dataset
# limited_orders.dataset.yml
name: limited_orders
extends:
path: orders.dataset.yml # Path to base file
omit_views: # Optional: exclude specific views from base
- deliveriesHow 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 (
namefor fields,viewfor 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) andomit_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.ymlfiles can extend:- First-party Count views (
.view.yml) - Views generated from LookML view files (
.view.lkml) - Views generated from Snowflake YAML files
- Views generated from OSI YAML files
- First-party Count views (
.dataset.ymlfiles can extend:- First-party Count datasets (
.dataset.yml) - Datasets generated from LookML explore or model files (
.explore.lkmland.model.lkml) - Datasets generated from Snowflake YAML files
- Datasets generated from OSI YAML files
- First-party Count datasets (
See here for more details about extending views/datasets generated from third-party files.