aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-02-12 19:03:01 -0800
committerBryan Newbold <bnewbold@archive.org>2020-02-12 19:03:01 -0800
commit21b88e3852614186b749bca542c2a2401b6c3ce4 (patch)
treeb6d5c9c2ba1bca675f8e2d53c0a3ac9b75e26481
parentad4c2c97e0ef0153b1161b2b71dadeee3e88a631 (diff)
downloadsandcrawler-21b88e3852614186b749bca542c2a2401b6c3ce4.tar.gz
sandcrawler-21b88e3852614186b749bca542c2a2401b6c3ce4.zip
dump_regrobid_pdf_petabox.sql script
-rw-r--r--sql/dump_regrobid_pdf_petabox.sql15
1 files changed, 15 insertions, 0 deletions
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;