{"action":"created","comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/45924044","id":45924044,"diff_hunk":"@@ -0,0 +1,78 @@\n+-- Tell sqlcmd to batch the following commands together,\n+-- so that the schema loads quickly.\n+file -inlinebatch END_OF_BATCH\n+\n+-- This table contains one row for each advertiser who can bid on ad\n+-- impressions (that is, an ad being shown to a user on their mobile\n+-- device).\n+CREATE TABLE advertisers\n+(\n+  id bigint not null\n+, name varchar(256) not null\n+, primary key (id)\n+);\n+\n+-- This table has one row for each bid made by an advertiser.  A bid\n+-- is valid for the duration of time between ts_start and ts_end and\n+-- the region indictated.\n+--\n+-- When a user logs in from a place and time where more than one bid\n+-- applies, an ad from the highest bidder (largest bid_amount) will be\n+-- served.\n+--\n+-- Expired bids (for which ts_end is older than current_timestamp)\n+-- should be purged periodically.\n+CREATE TABLE bids\n+(\n+  id bigint not null\n+, advertiser_id bigint not null\n+, region geography not null\n+, ts_start timestamp not null\n+, ts_end timestamp not null\n+, bid_amount float not null\n+, primary key (id)\n+);\n+\n+-- This table has one row for each device that is being served ads,\n+-- including the location from where it last appeared.\n+CREATE TABLE devices\n+(\n+  id bigint not null\n+, location point not null\n+, primary key (id)\n+);\n+\n+partition table devices on column id;\n+\n+-- This table contains one row for each ad served to a device\n+CREATE TABLE impressions\n+(\n+  bid_id bigint not null\n+, advertiser_id bigint not null\n+, bid_amount float not null\n+, device_id bigint not null\n+, ts timestamp not null\n+);\n+\n+partition table impressions on column device_id;\n+\n+-- This materiazlied view aggregates the number of ads served from\n+-- each advertiser per minute, and the amount their account will be\n+-- charged.\n+CREATE VIEW impressions_by_minute_by_advertiser\n+(\n+  ts_minute\n+, advertiser_id\n+, impression_count\n+, sum_of_impression_revenue\n+)\n+AS\n+  select\n+    truncate(minute, ts) as ts_minute","path":"examples/geospatial/ddl.sql","position":71,"original_position":71,"commit_id":"4a197d78c9bfdad76ed9ff8192e5e58f60cc8a4c","original_commit_id":"4a197d78c9bfdad76ed9ff8192e5e58f60cc8a4c","user":{"login":"wolffcm","id":7902964,"avatar_url":"https://avatars.githubusercontent.com/u/7902964?v=3","gravatar_id":"","url":"https://api.github.com/users/wolffcm","html_url":"https://github.com/wolffcm","followers_url":"https://api.github.com/users/wolffcm/followers","following_url":"https://api.github.com/users/wolffcm/following{/other_user}","gists_url":"https://api.github.com/users/wolffcm/gists{/gist_id}","starred_url":"https://api.github.com/users/wolffcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolffcm/subscriptions","organizations_url":"https://api.github.com/users/wolffcm/orgs","repos_url":"https://api.github.com/users/wolffcm/repos","events_url":"https://api.github.com/users/wolffcm/events{/privacy}","received_events_url":"https://api.github.com/users/wolffcm/received_events","type":"User","site_admin":false},"body":"This should be seconds, it's more exciting.","created_at":"2015-11-25T22:00:07Z","updated_at":"2015-11-25T22:00:07Z","html_url":"https://github.com/VoltDB/voltdb/pull/3037#discussion_r45924044","pull_request_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037","_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/45924044"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/3037#discussion_r45924044"},"pull_request":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037"}}},"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037","id":51593350,"html_url":"https://github.com/VoltDB/voltdb/pull/3037","diff_url":"https://github.com/VoltDB/voltdb/pull/3037.diff","patch_url":"https://github.com/VoltDB/voltdb/pull/3037.patch","issue_url":"https://api.github.com/repos/VoltDB/voltdb/issues/3037","number":3037,"state":"open","locked":false,"title":"A DDL file for geospatial example app","user":{"login":"wolffcm","id":7902964,"avatar_url":"https://avatars.githubusercontent.com/u/7902964?v=3","gravatar_id":"","url":"https://api.github.com/users/wolffcm","html_url":"https://github.com/wolffcm","followers_url":"https://api.github.com/users/wolffcm/followers","following_url":"https://api.github.com/users/wolffcm/following{/other_user}","gists_url":"https://api.github.com/users/wolffcm/gists{/gist_id}","starred_url":"https://api.github.com/users/wolffcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolffcm/subscriptions","organizations_url":"https://api.github.com/users/wolffcm/orgs","repos_url":"https://api.github.com/users/wolffcm/repos","events_url":"https://api.github.com/users/wolffcm/events{/privacy}","received_events_url":"https://api.github.com/users/wolffcm/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-23T22:59:08Z","updated_at":"2015-11-25T22:00:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8db153d360aae2ee6771c8bf3298631a9935210","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037/commits","review_comments_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037/comments","review_comment_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/issues/3037/comments","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/4a197d78c9bfdad76ed9ff8192e5e58f60cc8a4c","head":{"label":"VoltDB:ENG-9430-geo-example-ddl","ref":"ENG-9430-geo-example-ddl","sha":"4a197d78c9bfdad76ed9ff8192e5e58f60cc8a4c","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","created_at":"2011-09-23T18:46:12Z","updated_at":"2015-11-21T20:40:55Z","pushed_at":"2015-11-25T21:22:00Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":320254,"stargazers_count":671,"watchers_count":671,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"open_issues_count":31,"forks":204,"open_issues":31,"watchers":671,"default_branch":"master"}},"base":{"label":"VoltDB:ENG-8859-geospatial","ref":"ENG-8859-geospatial","sha":"aef9c0bc5919843446163df4c71e277f37cb8a14","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","created_at":"2011-09-23T18:46:12Z","updated_at":"2015-11-21T20:40:55Z","pushed_at":"2015-11-25T21:22:00Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":320254,"stargazers_count":671,"watchers_count":671,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"open_issues_count":31,"forks":204,"open_issues":31,"watchers":671,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/3037"},"issue":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/3037"},"comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/3037/comments"},"review_comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037/comments"},"review_comment":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/3037/commits"},"statuses":{"href":"https://api.github.com/repos/VoltDB/voltdb/statuses/4a197d78c9bfdad76ed9ff8192e5e58f60cc8a4c"}}}}