bigquery-etl/sql_generators
Anna Scholtz 1fe5f2d095
Add back normalized_app_id (#4580)
2023-11-17 12:06:53 -08:00
..
active_users Funnel generators POC (#4390) 2023-10-12 14:05:08 -07:00
active_users_deletion_requests Bug 1852517 - Add execution delta to metadata & dag (#4239) 2023-10-12 18:18:24 +02:00
country_code_lookup Adding 3 more Google Analytic country spellings. (#3686) 2023-03-27 14:12:37 -04:00
derived_view_schemas DS-2642 - Add plan, product, and customer shipping info to stripe itemized report (#3998) 2023-10-10 10:33:31 -07:00
events_daily Include VPN iOS native Glean events in VPN ETLs. (#4269) 2023-09-12 17:14:00 -07:00
experiment_monitoring DENG-476 - Update experiment aggregates ETL to reference main_v5 (#4435) 2023-10-26 10:12:19 -07:00
feature_usage Split main_1pct (#4022) 2023-07-05 13:00:29 -07:00
funnels Fix funnel generation logic (#4514) 2023-11-02 13:19:40 -07:00
glean_usage Add back normalized_app_id (#4580) 2023-11-17 12:06:53 -08:00
search Change `bqetl format` to improve readability of `CASE` statements (#3546) 2023-02-03 14:35:59 -08:00
serp_events DENG1546 - Fix bqetl_serp DAG failure (#4429) 2023-10-17 15:51:48 -04:00
stable_views Materialized views and aggregated tables for event monitoring (#4478) 2023-11-01 14:20:20 -07:00
urlbar_events DENG-1781- Remove urlbar_events_temp_v2 view and repoint urlbar_events view to v2 (#4486) 2023-10-27 14:19:19 -04:00
README.md DENG-601 Update sql-generators README with deployment info. (#3562) 2023-02-02 18:48:43 +01:00
__init__.py Glean usage checks (#4445) 2023-10-17 17:03:41 -04:00

README.md

SQL generators

sql_generators/ contains scripts for generating SQL queries. Generated SQL query code should not be checked in to main. The scripts for generating SQL queries are executed by CI only and will are followed by generating Airflow DAGs.

Expected structure

The directories in sql_generators/ represent the generated queries and will contain all of the scripts and templates necessary to generate these queries. Each query-specific directory will contain a __init__.py file that contains the query generation logic. Optionally, a templates/ directory can be added which contains the Jinja templates queries are generated from.

Each __init__.py file needs to implement a generate() method that is configured as a click command. The bqetl CLI will automatically add these commands to the ./bqetl query generate command group.

After changes to a schema or adding new tables, the schema is automatically derived from the query and deployed the next day in DAG bqetl_artifact_deployment. Alternatively, it can be manually generated and deployed using ./bqetl generate all and ./bqetl query schema deploy.