From 21b88e3852614186b749bca542c2a2401b6c3ce4 Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@archive.org>
Date: Wed, 12 Feb 2020 19:03:01 -0800
Subject: dump_regrobid_pdf_petabox.sql script

---
 sql/dump_regrobid_pdf_petabox.sql | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 sql/dump_regrobid_pdf_petabox.sql

(limited to 'sql/dump_regrobid_pdf_petabox.sql')

diff --git a/sql/dump_regrobid_pdf_petabox.sql b/sql/dump_regrobid_pdf_petabox.sql
new file mode 100644
index 0000000..3ca8085
--- /dev/null
+++ b/sql/dump_regrobid_pdf_petabox.sql
@@ -0,0 +1,15 @@
+
+-- Run like:
+--   psql sandcrawler < dump_regrobid_pdf_petabox.sql
+--   cat dump_regrobid_pdf_petabox.2020-02-03.json | sort -S 4G | uniq -w 40 | cut -f2 > dump_regrobid_pdf_petabox.2020-02-03.uniq.json
+
+BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
+
+COPY (
+    SELECT petabox.sha1hex, row_to_json(petabox) FROM petabox
+    WHERE EXISTS (SELECT grobid.sha1hex FROM grobid WHERE petabox.sha1hex = grobid.sha1hex AND grobid.grobid_version IS NULL)
+)
+TO '/grande/snapshots/dump_regrobid_pdf_petabox.2020-02-03.json'
+WITH NULL '';
+
+ROLLBACK;
-- 
cgit v1.2.3

