{"action":"created","comment":{"url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/comments/120671258","pull_request_review_id":42653489,"id":120671258,"diff_hunk":"@@ -97,16 +97,102 @@ var histogramQueryTpl = dot.template([\n     'ORDER BY bin'\n ].join('\\n'));\n \n+var dateBasicsQueryTpl = dot.template([\n+    'basics AS (',\n+    '    SELECT',\n+    '        max(date_part(\\'epoch\\', {{=it._column}})) AS max_val,',\n+    '        min(date_part(\\'epoch\\', {{=it._column}})) AS min_val,',\n+    '        avg(date_part(\\'epoch\\', {{=it._column}})) AS avg_val,',","path":"lib/cartodb/models/dataview/histogram.js","position":18,"original_position":18,"commit_id":"47af0131574c510c873ffce55575c639f2cf659f","original_commit_id":"47af0131574c510c873ffce55575c639f2cf659f","user":{"login":"ethervoid","id":741240,"avatar_url":"https://avatars0.githubusercontent.com/u/741240?v=3","gravatar_id":"","url":"https://api.github.com/users/ethervoid","html_url":"https://github.com/ethervoid","followers_url":"https://api.github.com/users/ethervoid/followers","following_url":"https://api.github.com/users/ethervoid/following{/other_user}","gists_url":"https://api.github.com/users/ethervoid/gists{/gist_id}","starred_url":"https://api.github.com/users/ethervoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethervoid/subscriptions","organizations_url":"https://api.github.com/users/ethervoid/orgs","repos_url":"https://api.github.com/users/ethervoid/repos","events_url":"https://api.github.com/users/ethervoid/events{/privacy}","received_events_url":"https://api.github.com/users/ethervoid/received_events","type":"User","site_admin":false},"body":"This is going to fail in the `avg` which doesn't support date/time. You have to cast it to numeric date_part(....)::numeric if not you're going to get:\r\n```\r\nfunction avg(timestamp with time zone) does not exist\r\n```","created_at":"2017-06-07T16:08:59Z","updated_at":"2017-06-07T16:08:59Z","html_url":"https://github.com/CartoDB/Windshaft-cartodb/pull/698#discussion_r120671258","pull_request_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698","_links":{"self":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/comments/120671258"},"html":{"href":"https://github.com/CartoDB/Windshaft-cartodb/pull/698#discussion_r120671258"},"pull_request":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698"}}},"pull_request":{"url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698","id":123760687,"html_url":"https://github.com/CartoDB/Windshaft-cartodb/pull/698","diff_url":"https://github.com/CartoDB/Windshaft-cartodb/pull/698.diff","patch_url":"https://github.com/CartoDB/Windshaft-cartodb/pull/698.patch","issue_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/698","number":698,"state":"open","locked":false,"title":"Support histograms with date/time expressions for aggregations","user":{"login":"dgaubert","id":1936888,"avatar_url":"https://avatars3.githubusercontent.com/u/1936888?v=3","gravatar_id":"","url":"https://api.github.com/users/dgaubert","html_url":"https://github.com/dgaubert","followers_url":"https://api.github.com/users/dgaubert/followers","following_url":"https://api.github.com/users/dgaubert/following{/other_user}","gists_url":"https://api.github.com/users/dgaubert/gists{/gist_id}","starred_url":"https://api.github.com/users/dgaubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgaubert/subscriptions","organizations_url":"https://api.github.com/users/dgaubert/orgs","repos_url":"https://api.github.com/users/dgaubert/repos","events_url":"https://api.github.com/users/dgaubert/events{/privacy}","received_events_url":"https://api.github.com/users/dgaubert/received_events","type":"User","site_admin":false},"body":"Fixes #691","created_at":"2017-06-02T17:05:30Z","updated_at":"2017-06-07T16:08:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a17f503ef294d63efb55b893f9d02a11f2cce50","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698/commits","review_comments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698/comments","review_comment_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/698/comments","statuses_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/statuses/47af0131574c510c873ffce55575c639f2cf659f","head":{"label":"CartoDB:691-date-histogram","ref":"691-date-histogram","sha":"47af0131574c510c873ffce55575c639f2cf659f","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2325416,"name":"Windshaft-cartodb","full_name":"CartoDB/Windshaft-cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/Windshaft-cartodb","description":"Windshaft tailored for CartoDB","fork":false,"url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb","forks_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/deployments","created_at":"2011-09-04T23:35:06Z","updated_at":"2017-03-29T23:34:14Z","pushed_at":"2017-06-07T14:12:11Z","git_url":"git://github.com/CartoDB/Windshaft-cartodb.git","ssh_url":"git@github.com:CartoDB/Windshaft-cartodb.git","clone_url":"https://github.com/CartoDB/Windshaft-cartodb.git","svn_url":"https://github.com/CartoDB/Windshaft-cartodb","homepage":"","size":30513,"stargazers_count":46,"watchers_count":46,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":55,"forks":39,"open_issues":55,"watchers":46,"default_branch":"master"}},"base":{"label":"CartoDB:master","ref":"master","sha":"02bf1dd2d7dee13071b815a8ba21466f22a81680","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2325416,"name":"Windshaft-cartodb","full_name":"CartoDB/Windshaft-cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/Windshaft-cartodb","description":"Windshaft tailored for CartoDB","fork":false,"url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb","forks_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/deployments","created_at":"2011-09-04T23:35:06Z","updated_at":"2017-03-29T23:34:14Z","pushed_at":"2017-06-07T14:12:11Z","git_url":"git://github.com/CartoDB/Windshaft-cartodb.git","ssh_url":"git@github.com:CartoDB/Windshaft-cartodb.git","clone_url":"https://github.com/CartoDB/Windshaft-cartodb.git","svn_url":"https://github.com/CartoDB/Windshaft-cartodb","homepage":"","size":30513,"stargazers_count":46,"watchers_count":46,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":55,"forks":39,"open_issues":55,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698"},"html":{"href":"https://github.com/CartoDB/Windshaft-cartodb/pull/698"},"issue":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/698"},"comments":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/698/comments"},"review_comments":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698/comments"},"review_comment":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/pulls/698/commits"},"statuses":{"href":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/statuses/47af0131574c510c873ffce55575c639f2cf659f"}}}}
{"actor":{"display_login":"ethervoid"}}