Page MenuHomePhabricator

Daily sqoops for logging and cu_log tables
Open, Needs TriagePublic

Description

In the context of migrating the metric dbt jobs to use wmf_mediawiki.mediawiki_history_incremental_v1 in a weekly fashion, the following MW tables have to be sqooped daile:

  • logging
  • cu_log

Checklist of completion:

  • puppet changes to allow the daily sqoops
  • creation of Hive tables
  • creation of delete jobs to keep the last 60 days of data
  • repairing table job in Airflow

Event Timeline

The logging sqoop succeeded with the configuration:

/usr/bin/python3 /srv/deployment/analytics/refinery/bin/sqoop-mediawiki-tables \
    --job-name sqoop-mediawiki-loigging-$(/bin/date --date="yesterday" +'%Y-%m-%d') \
    --clouddb \
    --output-dir /path/to/raw/mediawiki/tables \
    --wiki-file /mnt/hdfs/wmf/data/wmf/mediawiki/database/grouped_wikis.csv \
    --tables logging \
    --user s53272 \
    --password-file /path/to/mysql-analytics-labsdb-client-pw.txt\
    --from-timestamp $(/bin/date --date="yesterday" +'%Y%m%d000000') \
    --to-timestamp   $(/bin/date              +'%Y%m%d000000') \
    --partition-name day \
    --partition-value $(/bin/date --date="yesterday" +'%Y-%m-%d') \
    --mappers 64 \
    --processors 10 \
    --yarn-queue default \
    --output-format avrodata \
    --log-file sqoop-test/log/refinery/sqoop-mediawiki.log

It took roughly 1 hour and this is the du:

hdfs dfs -du -h -s  /path/to/raw/mediawiki/tables/logging/day=2026-07-14 

12.4 M  /path/to/raw/mediawiki/tables/logging/day=2026-07-14

Regarding the target path, I was thinking of using wmf/data/raw/mediawiki[_private]/tables/daily/name_of_the_table in order to physically divide the daily sqoops from the monthly sqoops.

The cu_log sqoop succeeded with the configuration:

/usr/bin/python3 /srv/deployment/analytics/refinery/bin/sqoop-mediawiki-tables \
    --job-name sqoop-mediawiki-daily-private-$(/bin/date --date="yesterday" +'%Y-%m-%d') \
    --output-dir /path/to/raw/mediawiki_private/tables \
    --wiki-file /mnt/hdfs/wmf/data/wmf/mediawiki/database/grouped_wikis.csv \
    --tables cu_log \
    --user research \
    --password-file /path/to/mysql-analytics-research-client-pw.txt \
    --from-timestamp $(/bin/date --date="yesterday" +'%Y%m%d000000') \
    --to-timestamp   $(/bin/date              +'%Y%m%d000000') \
    --partition-name day \
    --partition-value $(/bin/date --date="yesterday" +'%Y-%m-%d') \
    --mappers 4 \
    --processors 10 \
    --output-format avrodata \
    --yarn-queue default \
    --log-file sqoop-test/log/refinery/sqoop-mediawiki-private-daily.log

It took roughly 2 hours and this is the du:

hdfs dfs -du -h -s  path/to/raw/mediawiki_private/tables/cu_log/day=2026-07-14 

1.6 M   /path/to/raw/mediawiki/tables/logging/day=2026-07-14

Change #1311398 had a related patch set uploaded (by A-pizzata; author: A-pizzata):

[analytics/refinery@master] Add creation statement for daily sqooped tables cu_log and logging.

https://gerrit.wikimedia.org/r/1311398

Change #1311397 had a related patch set uploaded (by A-pizzata; author: A-pizzata):

[operations/puppet@production] Daily sqoops for logging and cu_log tables

https://gerrit.wikimedia.org/r/1311397

Change #1311397 merged by Brouberol:

[operations/puppet@production] Daily sqoops for logging and cu_log tables

https://gerrit.wikimedia.org/r/1311397

Change #1311398 merged by A-pizzata:

[analytics/refinery@master] Add creation statement for daily sqooped tables cu_log and logging.

https://gerrit.wikimedia.org/r/1311398

Change #1313228 had a related patch set uploaded (by A-pizzata; author: A-pizzata):

[operations/puppet@production] Fix daily sqoop.

https://gerrit.wikimedia.org/r/1313228

Change #1313228 merged by Btullis:

[operations/puppet@production] Fix daily sqoop.

https://gerrit.wikimedia.org/r/1313228

hi @APizzata-WMF , since we have platform in the heartbeat metrics, i was wondering if mediawiki change_tag and change_tag_def was also in scope ?

change_tag and change_tag_def was also in scope

These are ingested daily in the stream table: event.mediawiki_revision_tags_change.

These are ingested daily in the stream table: event.mediawiki_revision_tags_change.

Adding on this, the stream has revision focused change_tags but it will be improved in T423935.

yes, i was going to add that these aren't revision related tags, we rely on change_tag and change_tag_def for getting the platform for moderator actions.

T423935 is phase II of incremental_mwh. so that means the weekly active UWERs metric will not have platform dimension as of now. I think thats ok. copying @Milimetric and @nshahquinn-wmf so we're all on the same page.

Change #1314729 had a related patch set uploaded (by A-pizzata; author: A-pizzata):

[operations/puppet@production] Add deletion jobs for mediawiki_logging_daily and mediawiki_private_cu_log_daily.

https://gerrit.wikimedia.org/r/1314729

Change #1314787 had a related patch set uploaded (by A-pizzata; author: A-pizzata):

[operations/puppet@production] Add deletion jobs for daily logging and cu_log tables.

https://gerrit.wikimedia.org/r/1314787

Change #1314729 abandoned by A-pizzata:

[operations/puppet@production] Add deletion jobs for mediawiki_logging_daily and mediawiki_private_cu_log_daily.

Reason:

duplicated

https://gerrit.wikimedia.org/r/1314729

Change #1314787 merged by Brouberol:

[operations/puppet@production] Add deletion jobs for daily logging and cu_log tables.

https://gerrit.wikimedia.org/r/1314787