Usage
derived_table: {
datagroup_trigger: my_datagroup
…
}
}
Hierarchydatagroup_trigger |
Default ValueNoneAcceptsThe name of a datagroup defined in the model file |
Definition
datagroup_trigger
lets you specify the datagroup to use as a caching policy for the derived table. The datagroup itself is defined in the model file using the datagroup
parameter.
Adding the datagroup_trigger
parameter to a derived table makes the derived table a persistent derived table (PDT). The table is written into a scratch schema on your database and regenerated as specified by the datagroup
parameter.
If you use datagroup_trigger
for your PDT, you don’t need to use the sql_trigger_value
or persist_for
parameters. If you do, you will get a warning in the Looker IDE, and only the datagroup_trigger
will be used.
Examples
Create a persistent native derived table called customer_orders
that is rebuilt when triggered by the datagroup named order_datagroup
:
Create a customer_orders
persistent derived table based on a SQL query that is rebuilt when triggered by the datagroup called etl_datagroup
:
Common challenges
If you have PDTs that are dependent on other PDTs, be careful not to specify incompatible datagroup caching policies.