Open
Description
I would like to add nested column descriptions to SQLMesh models. If running on BigQuery then the data type would be a RECORD type.
For example I don't just want to document the my_record
column, I want to document its nested fields my_record.field_1
and my_record.field_2
. All 3 must be described, not just the top level.
This is especially helpful for wide tables that are pre-joined for performance reasons at query time.
I expect the syntax may look like this:
model (
name my_dataset.my_table,
description "Contains rows.",
column_descriptions (
my_record = "Description of the my_record struct."
my_record.field_1 = "Description of field 1."
my_record.field_2 = "Description of field 2."
)
);
This functionality is present in dbt but is not available with sqlmesh. See below for how this is documented in a schema.yml file:
- name: my_record
description: Description of the my_record struct
data_type: struct
- name: my_record.field_1
description: Description of field 1.
data_type: string # example
- name: my_record.field_2
description: Description of field 2.
data_type: array<string> # example
This feature should work regardless if the column is a RECORD (aka STRUCT) or a REPEATED RECORD (aka ARRAY of STRUCTs).
Activity