initial add of query.sql and metadata.yaml files. (#6161)
* initial add of query.sql and metadata.yaml files * format sql file to stop Circle CI error * label count of client_ids, add schema.yaml file * add dag_name to metadata.yaml * take out extraneous columns, reorder to match query * add date partition parameter as first_seen_date * add period to end of descriptions * take out explicit dependency * make query more efficient by setting first_seen_date to equal @submission_date and explicity use Inner join instead of left
This commit is contained in:
Родитель
a767e65a21
Коммит
78a5582e43
|
@ -0,0 +1,26 @@
|
|||
friendly_name: Desktop New Profiles Aggregates
|
||||
description: |-
|
||||
This table aggregates the number of new profiles on a given day as well as recording if new profiles are DAU
|
||||
for desktop client_ids
|
||||
|
||||
owners:
|
||||
- mhirose@mozilla.com
|
||||
labels:
|
||||
application: firefox
|
||||
incremental: true
|
||||
schedule: daily
|
||||
depends_on_past: false
|
||||
owner1: mhirose
|
||||
scheduling:
|
||||
dag_name: bqetl_analytics_tables
|
||||
task_name: desktop_new_profiles_aggregates
|
||||
date_partition_parameter: first_seen_date
|
||||
parameters:
|
||||
- submission_date:DATE:{{ds}}
|
||||
bigquery:
|
||||
time_partitioning:
|
||||
type: day
|
||||
field: first_seen_date
|
||||
require_partition_filter: false
|
||||
expiration_days: null
|
||||
references: {}
|
|
@ -0,0 +1,57 @@
|
|||
SELECT
|
||||
cfs.first_seen_date,
|
||||
cfs.is_desktop,
|
||||
cfs.attribution_medium,
|
||||
cfs.attribution_source,
|
||||
cfs.attribution_campaign,
|
||||
cfs.attribution_content,
|
||||
cfs.attribution_dlsource,
|
||||
cfs.attribution_ua,
|
||||
(cfs.attribution_medium IS NOT NULL OR cfs.attribution_source IS NOT NULL) AS attributed,
|
||||
cfs.city,
|
||||
cfs.country,
|
||||
cfs.distribution_id,
|
||||
EXTRACT(YEAR FROM cfs.first_seen_date) AS first_seen_year,
|
||||
cfs.normalized_channel AS channel,
|
||||
cfs.os,
|
||||
cfs.os_version,
|
||||
cfs.normalized_os,
|
||||
cfs.normalized_os_version,
|
||||
cfs.locale,
|
||||
cfs.app_version,
|
||||
cfs.windows_version,
|
||||
cfs.windows_build_number,
|
||||
au.is_dau,
|
||||
COUNT(cfs.client_id) AS new_profiles
|
||||
FROM
|
||||
`moz-fx-data-shared-prod.telemetry.clients_first_seen` cfs
|
||||
INNER JOIN
|
||||
`moz-fx-data-shared-prod.telemetry.active_users` au
|
||||
ON au.client_id = cfs.client_id
|
||||
WHERE
|
||||
cfs.first_seen_date = @submission_date
|
||||
AND au.submission_date = @submission_date
|
||||
GROUP BY
|
||||
cfs.first_seen_date,
|
||||
cfs.is_desktop,
|
||||
cfs.attribution_medium,
|
||||
cfs.attribution_source,
|
||||
cfs.attribution_campaign,
|
||||
cfs.attribution_content,
|
||||
cfs.attribution_dlsource,
|
||||
cfs.attribution_ua,
|
||||
attributed,
|
||||
cfs.city,
|
||||
cfs.country,
|
||||
cfs.distribution_id,
|
||||
first_seen_year,
|
||||
channel,
|
||||
cfs.os,
|
||||
cfs.os_version,
|
||||
normalized_os,
|
||||
normalized_os_version,
|
||||
cfs.locale,
|
||||
cfs.app_version,
|
||||
cfs.windows_version,
|
||||
cfs.windows_build_number,
|
||||
au.is_dau
|
|
@ -0,0 +1,94 @@
|
|||
fields:
|
||||
- description: Date when clients were first seen.
|
||||
name: first_seen_date
|
||||
type: DATE
|
||||
- description: Indicates if the client is included in the desktop KPI.
|
||||
name: is_desktop
|
||||
type: BOOLEAN
|
||||
mode: NULLABLE
|
||||
- description: Category of the source, such as 'organic' for a search engine.
|
||||
name: attribution_medium
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Referring partner domain, when install happens via a known partner.
|
||||
name: attribution_source
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Identifier of the particular campaign that led to the download of the product.
|
||||
name: attribution_campaign
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Identifier to indicate the particular link within a campaign.
|
||||
name: attribution_content
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Identifier that indicates where installations of Firefox originated.
|
||||
name: attribution_dlsource
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Client's user agent, which corresponds to the web browser used to download the Firefox installer.
|
||||
name: attribution_ua
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: True if attribution_medium is not null AND attribution_source is not null.
|
||||
name: attributed
|
||||
type: BOOLEAN
|
||||
mode: NULLABLE
|
||||
- description: City retrieved as a result of a geographic lookup based on the client's IP address.
|
||||
name: city
|
||||
type: STRING
|
||||
- description: The ISO 3166-1 alpha-2 country code.
|
||||
name: country
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: The value of the `distribution.id` preference that identifies the Firefox distribution.
|
||||
name: distribution_id
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Year when the the clients were first seen.
|
||||
name: first_seen_year
|
||||
type: INT64
|
||||
- description: The Firefox channel, set to Other for unrecognized channel names.
|
||||
name: channel
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: OS name - not normalized_os.
|
||||
name: os
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: OS version - not normalized.
|
||||
name: os_version
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: The OS name, set to Other for unrecognized OS names.
|
||||
name: normalized_os
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: The OS version.
|
||||
name: normalized_os_version
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: The best locale that the application should be localized to.
|
||||
name: locale
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: The application version.
|
||||
name: app_version
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Combo of os, os_version, windows_build_number, NULL if not windows.
|
||||
name: windows_version
|
||||
type: STRING
|
||||
mode: NULLABLE
|
||||
- description: Windows build number.
|
||||
name: windows_build_number
|
||||
type: FLOAT64
|
||||
mode: NULLABLE
|
||||
- description: Is the client active or not on the date.
|
||||
name: is_dau
|
||||
type: BOOLEAN
|
||||
mode: NULLABLE
|
||||
- description: Count of clients that are new on this date.
|
||||
name: new_profiles
|
||||
type: INT64
|
||||
mode: NULLABLE
|
Загрузка…
Ссылка в новой задаче