summaryrefslogtreecommitdiff
path: root/queries/match.sql
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-02-26 17:21:00 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-02-26 17:21:00 +0100
commit4c05d4522bb559394f99147cae56ab34b077f0d8 (patch)
treeb5c8df31ad2fce3fedcfc564297496d191d3b11f /queries/match.sql
parent9ae212a23754035be50e9125a7966544e2d525fb (diff)
downloadprocessor-4c05d4522bb559394f99147cae56ab34b077f0d8.tar.gz
processor-4c05d4522bb559394f99147cae56ab34b077f0d8.zip
rewrite to use joblib (fixes #20), use updated raw schema, check for duplicates
Diffstat (limited to 'queries/match.sql')
-rw-r--r--queries/match.sql22
1 files changed, 11 insertions, 11 deletions
diff --git a/queries/match.sql b/queries/match.sql
index 5dfa692..1e6d37f 100644
--- a/queries/match.sql
+++ b/queries/match.sql
@@ -1,15 +1,15 @@
SELECT
-id AS "apiId",
-(attributes->>'createdAt')::timestamp as "createdAt",
-(attributes->>'duration')::int AS "duration",
-attributes->>'gameMode' AS "gameMode",
-COALESCE(NULLIF(attributes->>'patchVersion', ''), '0') AS "patchVersion",
-attributes->>'shardId' AS "shardId",
-attributes->'stats'->>'endGameReason' AS "endGameReason",
-attributes->'stats'->>'queue' AS "queue" --,
+match.id AS "apiId",
+(match.data->'data'->'attributes'->>'createdAt')::timestamp as "createdAt",
+(match.data->'data'->'attributes'->>'duration')::int AS "duration",
+match.data->'data'->'attributes'->>'gameMode' AS "gameMode",
+COALESCE(NULLIF(match.data->'data'->'attributes'->>'patchVersion', ''), '0') AS "patchVersion",
+match.data->'data'->'attributes'->>'shardId' AS "shardId",
+match.data->'data'->'attributes'->'stats'->>'endGameReason' AS "endGameReason",
+match.data->'data'->'attributes'->'stats'->>'queue' AS "queue",
---relationships->'rosters'->'data'->0->>'id' as "roster_1",
---relationships->'rosters'->'data'->1->>'id' as "roster_2"
+match.data->'relations'->0->'data'->>'id' as "roster_1",
+match.data->'relations'->1->'data'->>'id' as "roster_2"
-FROM "match"
+FROM match WHERE id=$1