CREATE TEMP FUNCTION URLDECODE
(
    url STRING
)
RETURNS STRING
 AS ((
  SELECT 1
  FROM UNNEST(REGEXP_EXTRACT_ALL(url, r"%[0-9a-fA-F]{2}|[^%]+")) AS y WITH OFFSET AS i
))
