diff options
Diffstat (limited to 'sql/dump_reingest_quarterly.sql')
-rw-r--r-- | sql/dump_reingest_quarterly.sql | 81 |
1 files changed, 15 insertions, 66 deletions
diff --git a/sql/dump_reingest_quarterly.sql b/sql/dump_reingest_quarterly.sql index 972e9fe..917d88b 100644 --- a/sql/dump_reingest_quarterly.sql +++ b/sql/dump_reingest_quarterly.sql @@ -3,11 +3,19 @@ COPY ( SELECT row_to_json(ingest_request.*) FROM ingest_request LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url WHERE ingest_request.ingest_type = 'pdf' - AND ingest_file_result.ingest_type = 'pdf' + AND ingest_file_result.hit = false AND ingest_request.created < NOW() - '8 hour'::INTERVAL AND ingest_request.created > NOW() - '91 day'::INTERVAL - AND ingest_file_result.hit = false - AND ingest_file_result.status like 'spn2-%' + AND (ingest_request.ingest_request_source = 'fatcat-changelog' + OR ingest_request.ingest_request_source = 'fatcat-ingest') + AND ( + ingest_file_result.status like 'spn2-%' + OR ingest_file_result.status like 'cdx-error' + OR ingest_file_result.status like 'wayback-error' + OR ingest_file_result.status like 'wayback-content-error' + OR ingest_file_result.status like 'petabox-error' + OR ingest_file_result.status like 'gateway-timeout' + ) AND ingest_file_result.status != 'spn2-error:invalid-url-syntax' AND ingest_file_result.status != 'spn2-error:filesize-limit' AND ingest_file_result.status != 'spn2-error:not-found' @@ -15,68 +23,9 @@ COPY ( AND ingest_file_result.status != 'spn2-error:too-many-redirects' AND ingest_file_result.status != 'spn2-error:network-authentication-required' AND ingest_file_result.status != 'spn2-error:unknown' -) TO '/srv/sandcrawler/tasks/reingest_quarterly_spn2-error_current.rows.json'; +) TO '/srv/sandcrawler/tasks/reingest_weekly_current.rows.json'; -COPY ( - SELECT row_to_json(ingest_request.*) FROM ingest_request - LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url - WHERE ingest_request.ingest_type = 'pdf' - AND ingest_file_result.ingest_type = 'pdf' - AND ingest_file_result.hit = false - AND ingest_file_result.status like 'cdx-error' - AND ingest_request.created < NOW() - '8 hour'::INTERVAL - AND ingest_request.created > NOW() - '91 day'::INTERVAL - AND (ingest_request.ingest_request_source = 'fatcat-changelog' - OR ingest_request.ingest_request_source = 'fatcat-ingest') -) TO '/srv/sandcrawler/tasks/reingest_quarterly_cdx-error_current.rows.json'; - -COPY ( - SELECT row_to_json(ingest_request.*) FROM ingest_request - LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url - WHERE ingest_request.ingest_type = 'pdf' - AND ingest_file_result.ingest_type = 'pdf' - AND ingest_file_result.hit = false - AND ingest_file_result.status like 'cdx-error' - AND ingest_request.created < NOW() - '8 hour'::INTERVAL - AND ingest_request.created > NOW() - '91 day'::INTERVAL - AND (ingest_request.ingest_request_source != 'fatcat-changelog' - AND ingest_request.ingest_request_source != 'fatcat-ingest') -) TO '/srv/sandcrawler/tasks/reingest_quarterly_cdx-error_bulk_current.rows.json'; - -COPY ( - SELECT row_to_json(ingest_request.*) FROM ingest_request - LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url - WHERE ingest_request.ingest_type = 'pdf' - AND ingest_file_result.ingest_type = 'pdf' - AND ingest_file_result.hit = false - AND ingest_file_result.status like 'wayback-error' - AND ingest_request.created < NOW() - '8 hour'::INTERVAL - AND ingest_request.created > NOW() - '91 day'::INTERVAL -) TO '/srv/sandcrawler/tasks/reingest_quarterly_wayback-error_current.rows.json'; - -COPY ( - SELECT row_to_json(ingest_request.*) FROM ingest_request - LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url - WHERE ingest_request.ingest_type = 'pdf' - AND ingest_file_result.ingest_type = 'pdf' - AND ingest_file_result.hit = false - AND ingest_file_result.status like 'gateway-timeout' - AND ingest_request.created < NOW() - '8 hour'::INTERVAL - AND ingest_request.created > NOW() - '91 day'::INTERVAL - AND (ingest_request.ingest_request_source = 'fatcat-changelog' - OR ingest_request.ingest_request_source = 'fatcat-ingest') -) TO '/srv/sandcrawler/tasks/reingest_quarterly_gateway-timeout.rows.json'; - -COPY ( - SELECT row_to_json(ingest_request.*) FROM ingest_request - LEFT JOIN ingest_file_result ON ingest_file_result.base_url = ingest_request.base_url - WHERE ingest_request.ingest_type = 'pdf' - AND ingest_file_result.ingest_type = 'pdf' - AND ingest_file_result.hit = false - AND ingest_file_result.status like 'petabox-error' - AND ingest_request.created < NOW() - '8 hour'::INTERVAL - AND ingest_request.created > NOW() - '91 day'::INTERVAL - AND (ingest_request.ingest_request_source = 'fatcat-changelog' - OR ingest_request.ingest_request_source = 'fatcat-ingest') -) TO '/srv/sandcrawler/tasks/reingest_quarterly_petabox-error_current.rows.json'; +-- bulk re-tries would be: +-- AND (ingest_request.ingest_request_source != 'fatcat-changelog' +-- AND ingest_request.ingest_request_source != 'fatcat-ingest') |