aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dump_unextracted_pdf_petabox.sql
blob: 7db34fb83be954133041af3c98b2f07159a92a2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

-- Run like:
--   psql sandcrawler < dump_unextracted_pdf_petabox.sql

BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;

COPY (
  SELECT DISTINCT ON (petabox.sha1hex) row_to_json(petabox)
  FROM grobid
  LEFT JOIN petabox ON grobid.sha1hex = petabox.sha1hex
  LEFT JOIN pdf_meta ON grobid.sha1hex = pdf_meta.sha1hex
  WHERE petabox.sha1hex IS NOT NULL
    AND pdf_meta.sha1hex IS NULL
)
TO '/grande/snapshots/dump_unextracted_pdf_petabox.2020-07-22.json'
WITH NULL '';

ROLLBACK;