bigquery-etl/sql_generators
Anna Scholtz b0387fb7de
Remove referenced_tables usages (#4834)
* Remove referenced_tables usages

* Resolve check dependencies when generating DAGs

* Add tests for checks automatically resolving dependencies

* Incorporate feedback for removing referenced_tables

* Use depends_on for empty_checks

* More depends_on and fixes
2024-01-22 12:41:05 -08:00
..
active_users Indent join conditions (#4223) 2024-01-11 15:50:26 -08:00
active_users_deletion_requests Indent join conditions (#4223) 2024-01-11 15:50:26 -08:00
country_code_lookup Adding 3 more Google Analytic country spellings. (#3686) 2023-03-27 14:12:37 -04:00
derived_view_schemas Restrict derived view schema generation to views with upstream schema files and directly copy reference schemas for simple views. (#4848) 2024-01-19 16:24:50 -05:00
events_daily Remove referenced_tables usages (#4834) 2024-01-22 12:41:05 -08: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 Indent join conditions (#4223) 2024-01-11 15:50:26 -08:00
glean_usage Remove referenced_tables usages (#4834) 2024-01-22 12:41:05 -08:00
search Indent join conditions (#4223) 2024-01-11 15:50:26 -08:00
serp_events Indent join conditions (#4223) 2024-01-11 15:50:26 -08:00
stable_views Revert "Define `event_monitoring_live_v1` views in `view.sql` files (#4576)" (#4680) 2023-12-11 10:15:30 -08:00
urlbar_events Event flows monitoring (#4744) 2024-01-11 11:43:18 -08:00
use_counters 1866834 - add public json true flag (#4855) 2024-01-18 11:13:29 -06: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.