Page MenuHomePhabricator

Handle media links at parsing time
Open, Needs TriagePublic

Description

Optional media links handling is currently done after parsing wikitext, which entails an additional data transformation.
This seems to affect the pipeline execution time, likely due to Spark's query plan.

Extract media links in the parse UDF instead.

Raised in https://gitlab.wikimedia.org/repos/structured-data/section-topics/-/merge_requests/9#note_16038.

Tasks

  • expose media as another field in SECTIONS_SCHEMA
  • let the parse UDF separate media links from wikilinks
  • remove handle_media
  • select section.media and write to disk if --handle-media is passed in the CLI