Bigquery ETL
Перейти к файлу
skahmann3 5c6772a5b6
ADPRODUCTS-367: sponsored_tiles_clients_daily (#3203)
* sponsored_tiles_clients_daily

Client-level code for desktop + mobile. Issue with UNION ALL for desktop and mobile tables as the experiments structure is different between the devices

* Delete .pre-commit-config.yaml

* fix: experiments

* initial commit for sponsored tiles clients daily

* Add submission_date

* Clean up dag imports

* Revert import change, add dag to main summary

* Nan's edits

Co-authored-by: Rebecca BurWei <rburwei@mozilla.com>
Co-authored-by: Perry McManis <pmcmanis@mozilla.com>
Co-authored-by: Wil Stuckey <wstuckey@mozilla.com>
Co-authored-by: Curtis Morales <cmorales@mozilla.com>
2022-10-31 10:50:11 -04:00
.circleci Update CI to python 3.10 (#3248) 2022-10-05 11:32:53 -07:00
.github Add new derived dataset guideline to PR template. (#3296) 2022-10-20 11:26:38 +02:00
.vscode Remove .vscode settings and add to gitignore (#1929) 2021-03-30 12:25:05 -04:00
bigquery_etl ADPRODUCTS-367: Revamp the contextual services derived dataset (event_aggregates) (#3196) 2022-10-19 11:58:11 -05:00
dags ADPRODUCTS-367: sponsored_tiles_clients_daily (#3203) 2022-10-31 10:50:11 -04:00
docs Updated file paths (#3305) 2022-10-25 14:26:47 -07:00
script Move copy_deduplicate to CLI 2022-09-06 14:22:17 -07:00
sql ADPRODUCTS-367: sponsored_tiles_clients_daily (#3203) 2022-10-31 10:50:11 -04:00
sql_generators Add docs for glean_usage 2022-10-25 09:15:09 -07:00
src/main/java/com/mozilla/telemetry Reapply "Update to zetasql 2022.02.1 (#2862)" (#2881) 2022-04-07 14:02:20 -07:00
tests Add Glean iOS Focus and Klar to search metrics (#3285) 2022-10-18 13:52:53 -04:00
.bigqueryrc Create ~/.bigqueryrc without GCLOUD_SERVICE_KEY (#112) 2019-05-01 13:38:31 -07:00
.dockerignore Use zetasql to get dependencies for dag generation (#1817) 2021-02-18 17:49:46 -05:00
.eslintrc.yml Ran YAMLlint on all yaml files and resolved linting issues (fixes #1297) (#1481) 2020-10-29 17:24:55 -07:00
.flake8 Dryrun stored procedures (#1367) 2020-10-01 16:48:28 -04:00
.gitignore feat(): Adding ETL for monitoring_airflow datasets (#3204) 2022-10-12 10:57:24 +01:00
.isort.cfg Automatically sort python imports (#1840) 2021-02-24 17:11:52 -05:00
.pre-commit-config.yaml Add typing stubs to pre-commit mypy run (#3266) 2022-10-11 18:06:32 +02:00
.yamllint.yaml Move search to sql_generators/ 2022-01-03 14:15:02 -08:00
CODEOWNERS DSRE-695 Remove search-terms restrictions from quicksuggest ETL (#2908) 2022-06-21 20:44:30 +00:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#50) 2019-03-30 10:01:54 -07:00
CONTRIBUTING.md Add CODEOWNERS and restricted access datasets documentation (#2524) 2021-12-21 20:25:05 +00:00
Dockerfile Move to python 3.10 (#3236) 2022-09-22 15:39:40 -04:00
GRAVEYARD.md Remove asn_aggregates ETL (#2580) 2021-12-15 18:28:29 +00:00
LICENSE Add MPL license (#2353) 2021-09-20 17:59:47 +00:00
README.md Move to python 3.10 (#3236) 2022-09-22 15:39:40 -04:00
bqetl Use --no-deps when installing compiled requirements files (#2752) 2022-02-24 21:36:47 +00:00
conftest.py Reapply "Update to zetasql 2022.02.1 (#2862)" (#2881) 2022-04-07 14:02:20 -07:00
dags.yaml ADPRODUCTS-367: sponsored_tiles_clients_daily (#3203) 2022-10-31 10:50:11 -04:00
pom.xml Bump maven-jar-plugin from 3.2.2 to 3.3.0 (#3226) 2022-09-19 17:51:14 +00:00
pytest.ini Use zetasql to find sql dependencies (#1802) 2021-02-17 11:48:40 -08:00
requirements.in Bump types-pyyaml from 6.0.12 to 6.0.12.1 (#3308) 2022-10-28 19:14:16 +00:00
requirements.txt Bump types-pyyaml from 6.0.12 to 6.0.12.1 (#3308) 2022-10-28 19:14:16 +00:00
setup.py Move to python 3.10 (#3236) 2022-09-22 15:39:40 -04:00

README.md

CircleCI

BigQuery ETL

This repository contains Mozilla Data Team's:

  • Derived ETL jobs that do not require a custom container
  • User-defined functions (UDFs)
  • Airflow DAGs for scheduled bigquery-etl queries
  • Tools for query & UDF deployment, management and scheduling

For more information, see https://mozilla.github.io/bigquery-etl/

Quick Start

Apple Silicon (M1) user requirement

Enable Rosetta mode for your terminal BEFORE installing below tools using your terminal. It'll save you a lot of headaches. For tips on maintaining parallel stacks of python and homebrew running with and without Rosetta, see blog posts from Thinknum and Sixty North.

Pre-requisites

  • Pyenv (optional) Recommended if you want to install different versions of python, see instructions here. After the installation of pyenv, make sure that your terminal app is configured to run the shell as a login shell.
  • Homebrew (not required, but useful for Mac) - Follow the instructions here to install homebrew on your Mac.
  • Python 3.10+ - (see this guide for instructions if you're on a mac and haven't installed anything other than the default system Python).
  • Java JDK 8+ - (required for some functionality, e.g. AdoptOpenJDK) with $JAVA_HOME set.
  • Maven - (needed for downloading jar dependencies). Available via your package manager in most Linux distributions and from homebrew on mac, or you can install yourself by downloading a binary and following maven's install instructions.

GCP CLI tools

  • For Mozilla Employees or Contributors (not in Data Engineering) - Set up GCP command line tools, as described on docs.telemetry.mozilla.org. Note that some functionality (e.g. writing UDFs or backfilling queries) may not be allowed.
  • For Data Engineering - In addition to setting up the command line tools, you will want to log in to shared-prod if making changes to production systems. Run gcloud auth login --update-adc --project=moz-fx-data-shared-prod (if you have not run it previously).

Installing bqetl

  1. Clone the repository
git clone git@github.com:mozilla/bigquery-etl.git
cd bigquery-etl
  1. Install the bqetl command line tool
./bqetl bootstrap
  1. Install standard pre-commit hooks
venv/bin/pre-commit install
  1. Build and install java dependencies
mvn package
# specify `<(echo mozilla-bigquery-etl)` to retain bqetl from `./bqetl bootstrap`
venv/bin/pip-sync --pip-args=--no-deps requirements.txt <(echo mozilla-bigquery-etl)

Finally, if you are using Visual Studio Code, you may also wish to use our recommended defaults:

cp .vscode/settings.json.default .vscode/settings.json

And you should now be set up to start working in the repo! The easiest way to do this is for many tasks is to use bqetl. You may also want to read up on common workflows.