2024-11-22 06:47:21 +08:00
version : 2
2025-01-03 07:48:10 +08:00
models :
2024-11-22 06:47:21 +08:00
- name : the_name_of_the_semantic_model ## Required
description : same as always ## Optional
model: ref('some_model') ## Required : the database identifier of the table/view/mv that this semantic model relates to.
defaults: ## Required TODO : figure out exactly what this is.
agg_time_dimension : dimension_name ## Required if the model contains measures
2024-11-26 02:46:48 +08:00
aliases : [ ] ## Optional field that allows you to alias the semantic model, we will use this to replace the model name in the queries.
2024-11-22 06:47:21 +08:00
entities :
- name : <name of the entity> ## Required
type : Primary or natural or foreign or unique ## Required
description : A description of the field or role the entity takes in this table ## Optional
expr : The field that denotes that entity (transaction_id). ## Optional
2024-11-26 02:46:48 +08:00
join_type : inner ## Required on foreign entities. This helps buster understand how to join the entity to the table. [always_left, inner, full_outer, cross]
relationship_type : one_to_one ## Required on foreign entities. This helps buster understand the relationship between the entity and the table. [one_to_one, one_to_many, many_to_one, many_to_many]
2024-11-22 06:47:21 +08:00
measures :
- name : <name of the measure>
description : "same as always" ## Optional
agg : the aggregation type.
expr : the field
agg_params : "specific aggregation properties such as a percentile" ## Optional
agg_time_dimension : The time field. Defaults to the default agg time dimension for the semantic model. ## Optional
non_additive_dimension : "Use these configs when you need non-additive dimensions." ## Optional
2024-11-26 02:46:48 +08:00
alias : [ "alias for the measure" ] ## Optional
2024-11-22 06:47:21 +08:00
dimensions :
- name : <name of the dimension> # Required
type : Categorical or Time # Required
label : Recommended adding a string that defines the display value in downstream tools. # Optional
type_params : Specific type params such as if the time is primary or used as a partition # Required
description : Same as always # Optional
expr : The column name or expression. If not provided the default is the dimension name # Optional
2024-11-26 02:46:48 +08:00
sql : Can be sql that defines the dimension... like a case statement or something. # Optional
searchable : boolean # Optional if toggled to true, we search the dimension values based on the user search.
alias : [ "alias for the dimension" ] # Optional
timezone : "America/Los_Angeles" # Optional defaults to UTC.