This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.
Thanks! Just one more thing: I found out that the following attempt of
simplification: {% condition logs.time_filter %} logs._PARTITIONTIME {%
endcondition %} Actually breaks the query whenever setting the filters
to something that isn’t a whole day....
Nice! Building on top of this, I managed to eliminate the derived tables
entirely by moving the conditions to a sql_always_where in the explore.
Much cleaner and far more reusable now: explore: logs {
conditionally_filter: { filters: { field: logs.ti...
We’ve been using this technique a lot recently, and there’s still one
thing that I’m struggling with. We often need to join two
date-partitioned tables together. If I add a date filter to each of the
tables separately, then in the explore the user ha...
I came up with the following to allow easy filtering on specific times
(and not just dates) in a consistent way, while still pushing down the
_PARTITIONTIME condition: view: logs { derived_table: { sql: SELECT *
FROM my_dataset.my_logs_table WHERE _P...