Looker's new LookML runtime has been available since Looker 22.6. A "runtime" is the part of Looker that interprets LookML code. The new runtime is faster and checks for more LookML errors than the legacy runtime.
Looker will require all customers migrate to the new runtime in early 2025 and strongly encourages all customers to complete the migration before that time. The new LookML runtime is able to catch previously overlooked errors, so enabling the new runtime may cause new LookML errors to appear. These errors are not caused by the new runtime; rather, they are pre-existing errors that are now being found.
Additionally, customers that want to change their instance to Looker (Google Cloud core) must migrate to the new runtime beforehand.
How to switch to the new runtime
1. Turn off the "Use Legacy LookML Runtime" legacy feature if available
Some Looker are enabled with the Use Legacy LookML Runtime legacy feature. Disable the Use Legacy LookML Runtime legacy feature to transition the Looker instance to the new runtime.
If the Use Legacy LookML Runtime legacy feature is not available in the Legacy Features admin page of your Looker instance, your instance is already using the new runtime.
2. Ensure that your LookML projects are not configured with new_lookml_runtime:no
It is possible to override a Looker instance's global Use Legacy LookML Runtime setting by adding the new_lookml_runtime:no
statement in the manifest file of a LookML project.
Ensure that your LookML project manifest files do not have the new_lookml_runtime
parameter, or that new_lookml_runtime
is set to yes
on all LookML projects.
LookML issues the new runtime may find
After transitioning to the new runtime you may notice new errors in your LookML. The new errors are not caused by the new runtime; rather, they are pre-existing issues that are now being found.
Depending upon your LookML developer settings, you may be required to fix these errors before continuing to submit LookML changes. The following sections describe some of the issues that the new LookML runtime may find in your project and how to remedy them:
- Some Persistent Derived Tables may rebuild
- HTML literals inside Liquid expressions may be converted to Unicode
- Invalid references in
sql_distinct_key
results in "unknown view" - Distinct type measure with no primary key produce different SQL
- Accessing
_filters[]
in Liquid with a bare field reference will add the referenced field as a selected column
Some Persistent Derived Tables may rebuild
Persistent Derived Table (PDT) keys are based on SQL generated by the LookML runtime. In some cases the new runtime may generate different (but equivalent) SQL for a PDT, resulting in a different PDT key. A change of a PDT key will cause the PDT to rebuild.
HTML literals inside Liquid expressions may be converted to Unicode
HTML tags in Liquid expressions may get converted to their unicode equivalent by the new runtime. For example, a <strong>
tag may get converted to <strong>
. In the legacy runtime HTML tags could be compared directly, as in this example:
html:
{{ value |replace(""), "[" |replace(""), "]" }} ;;
In the new runtime comparisons need to be made against the unicode instead:
html:
{{ value |replace("<strong>"), "[" |replace("</strong>"), "]" }} ;;
Invalid references in sql_distinct_key
results in "unknown view"
With the new runtime a sql_distinct_key
that references an unknown field or view will throw an exception. For example:
measure: total_shipping {
type: sum_distinct
sql: ${order_shipping} ;;
sql_distinct_key: ${some_incorrect_field_name} ;;
}
"Distinct" type measure with no primary key produce different SQL
A distinct type measure (average_distinct
, count_distinct
, median_distinct
, percentile_distinct
, sum_distinct
) with no primary-key
or sql_distinct_key
parameter may produce different SQL in the new runtime.
Be sure to specify a primary-key
or sql_distinct_key
when building distinct type measures.
Accessing _filters[]
in Liquid with a bare field reference will add the referenced field as a selected column
In Looker a "bare field reference" is one that is not enclosed in curly braces, such as users.created_date
instead of ${users.created_date}
.
The legacy runtime ignored bare field references when used with the _filters
Liquid variable. The new runtime will add the field to the SQL query.
For example, in this dimension users.created_date
is a bare reference:
dimension: name {
html:
{% if _filters[users.created_date] != NULL %}
{{rendered_value}} (created: {{_filters[users.created_date]}})
{% else %}
{{rendered_value}}
{% endif %}
;;
}
In the legacy runtime _filters[users.created_date]
would have always been ignored and only the second condition if the {% if %}
would ever have been met. In the new runtime users.created_date
will be added to the SELECT
clause of the SQL query so that the condition can be evaluated.
The automatic addition of unexpected fields to Looker queries can be confusing to users, so best practice is not to use bare field references and instead use the ${field_name}
syntax.