{"action":"created","comment":{"url":"https://api.github.com/repos/getredash/redash/pulls/comments/57128267","id":57128267,"diff_hunk":"@@ -0,0 +1,130 @@\n+import json\n+import logging\n+import sys\n+\n+from redash.query_runner import *\n+from redash.utils import JSONEncoder\n+\n+logger = logging.getLogger(__name__)\n+\n+try:\n+    from dql import Engine, FragmentEngine\n+    enabled = True\n+except ImportError, e:\n+    enabled = False\n+\n+types_map = {\n+    'UNICODE': TYPE_INTEGER,\n+    'TINYINT': TYPE_INTEGER,\n+    'SMALLINT': TYPE_INTEGER,\n+    'INT': TYPE_INTEGER,\n+    'DOUBLE': TYPE_FLOAT,\n+    'DECIMAL': TYPE_FLOAT,\n+    'FLOAT': TYPE_FLOAT,\n+    'REAL': TYPE_FLOAT,\n+    'BOOLEAN': TYPE_BOOLEAN,\n+    'TIMESTAMP': TYPE_DATETIME,\n+    'DATE': TYPE_DATETIME,\n+    'CHAR': TYPE_STRING,\n+    'STRING': TYPE_STRING,\n+    'VARCHAR': TYPE_STRING\n+}\n+\n+\n+class DynamoDBSQL(BaseSQLQueryRunner):\n+    @classmethod\n+    def configuration_schema(cls):\n+        return {\n+            \"type\": \"object\",\n+            \"properties\": {\n+                \"region\": {\n+                    \"type\": \"string\",\n+                    \"default\": \"us-west-1\"\n+                },\n+                \"host\": {\n+                    \"type\": \"string\",\n+                    \"default\": \"127.0.0.1\"\n+                },\n+                \"port\": {\n+                    \"type\": \"number\",\n+                    \"default\": 8000\n+                },\n+                \"access_key\": {\n+                    \"type\": \"string\",\n+                    \"default\": \"anything\"\n+\n+                },\n+                \"secret_key\": {\n+                    \"type\": \"string\",\n+                    \"default\": \"anything\"\n+\n+                },\n+                \"is_secure\": {\n+                    \"type\": \"boolean\",\n+                    \"default\": False,\n+                }\n+            },\n+            \"required\": [\"host\"],\n+            \"secret\": [\"secret_key\"]\n+        }\n+\n+    @classmethod\n+    def annotate_query(cls):\n+        return False\n+\n+    @classmethod\n+    def type(cls):\n+        return \"ddb_sql\"","path":"redash/query_runner/dynamodb_sql.py","position":77,"original_position":77,"commit_id":"ad95a5eb5e8351b9aa6dc1667ad510e7d912b2b7","original_commit_id":"ad95a5eb5e8351b9aa6dc1667ad510e7d912b2b7","user":{"login":"arikfr","id":71468,"avatar_url":"https://avatars.githubusercontent.com/u/71468?v=3","gravatar_id":"","url":"https://api.github.com/users/arikfr","html_url":"https://github.com/arikfr","followers_url":"https://api.github.com/users/arikfr/followers","following_url":"https://api.github.com/users/arikfr/following{/other_user}","gists_url":"https://api.github.com/users/arikfr/gists{/gist_id}","starred_url":"https://api.github.com/users/arikfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikfr/subscriptions","organizations_url":"https://api.github.com/users/arikfr/orgs","repos_url":"https://api.github.com/users/arikfr/repos","events_url":"https://api.github.com/users/arikfr/events{/privacy}","received_events_url":"https://api.github.com/users/arikfr/received_events","type":"User","site_admin":false},"body":"`dynamodb_dql`","created_at":"2016-03-23T09:16:35Z","updated_at":"2016-03-23T09:16:35Z","html_url":"https://github.com/getredash/redash/pull/934#discussion_r57128267","pull_request_url":"https://api.github.com/repos/getredash/redash/pulls/934","_links":{"self":{"href":"https://api.github.com/repos/getredash/redash/pulls/comments/57128267"},"html":{"href":"https://github.com/getredash/redash/pull/934#discussion_r57128267"},"pull_request":{"href":"https://api.github.com/repos/getredash/redash/pulls/934"}}},"pull_request":{"url":"https://api.github.com/repos/getredash/redash/pulls/934","id":63204290,"html_url":"https://github.com/getredash/redash/pull/934","diff_url":"https://github.com/getredash/redash/pull/934.diff","patch_url":"https://github.com/getredash/redash/pull/934.patch","issue_url":"https://api.github.com/repos/getredash/redash/issues/934","number":934,"state":"open","locked":false,"title":"DynamoDB SQL query runner","user":{"login":"alexanderlz","id":1499009,"avatar_url":"https://avatars.githubusercontent.com/u/1499009?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderlz","html_url":"https://github.com/alexanderlz","followers_url":"https://api.github.com/users/alexanderlz/followers","following_url":"https://api.github.com/users/alexanderlz/following{/other_user}","gists_url":"https://api.github.com/users/alexanderlz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderlz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderlz/subscriptions","organizations_url":"https://api.github.com/users/alexanderlz/orgs","repos_url":"https://api.github.com/users/alexanderlz/repos","events_url":"https://api.github.com/users/alexanderlz/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderlz/received_events","type":"User","site_admin":false},"body":"Adds the ability to query DynamoDB using SQL!\r\n(with the help of the following library \r\nhttps://github.com/mathcamp/dql\r\n)","created_at":"2016-03-17T10:54:06Z","updated_at":"2016-03-23T09:16:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1f1bc570b19ecfd0eebefe535ec44d6f3f9b58d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/getredash/redash/pulls/934/commits","review_comments_url":"https://api.github.com/repos/getredash/redash/pulls/934/comments","review_comment_url":"https://api.github.com/repos/getredash/redash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getredash/redash/issues/934/comments","statuses_url":"https://api.github.com/repos/getredash/redash/statuses/ad95a5eb5e8351b9aa6dc1667ad510e7d912b2b7","head":{"label":"alexanderlz:master","ref":"master","sha":"ad95a5eb5e8351b9aa6dc1667ad510e7d912b2b7","user":{"login":"alexanderlz","id":1499009,"avatar_url":"https://avatars.githubusercontent.com/u/1499009?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderlz","html_url":"https://github.com/alexanderlz","followers_url":"https://api.github.com/users/alexanderlz/followers","following_url":"https://api.github.com/users/alexanderlz/following{/other_user}","gists_url":"https://api.github.com/users/alexanderlz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderlz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderlz/subscriptions","organizations_url":"https://api.github.com/users/alexanderlz/orgs","repos_url":"https://api.github.com/users/alexanderlz/repos","events_url":"https://api.github.com/users/alexanderlz/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderlz/received_events","type":"User","site_admin":false},"repo":{"id":14085943,"name":"redash","full_name":"alexanderlz/redash","owner":{"login":"alexanderlz","id":1499009,"avatar_url":"https://avatars.githubusercontent.com/u/1499009?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderlz","html_url":"https://github.com/alexanderlz","followers_url":"https://api.github.com/users/alexanderlz/followers","following_url":"https://api.github.com/users/alexanderlz/following{/other_user}","gists_url":"https://api.github.com/users/alexanderlz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderlz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderlz/subscriptions","organizations_url":"https://api.github.com/users/alexanderlz/orgs","repos_url":"https://api.github.com/users/alexanderlz/repos","events_url":"https://api.github.com/users/alexanderlz/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderlz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexanderlz/redash","description":"Rethinking how data is queried, shared and visualized. A web application that allows to easily query an existing database, share the dataset and visualize it in different ways. Oh and you can also create dashboards.","fork":true,"url":"https://api.github.com/repos/alexanderlz/redash","forks_url":"https://api.github.com/repos/alexanderlz/redash/forks","keys_url":"https://api.github.com/repos/alexanderlz/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexanderlz/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexanderlz/redash/teams","hooks_url":"https://api.github.com/repos/alexanderlz/redash/hooks","issue_events_url":"https://api.github.com/repos/alexanderlz/redash/issues/events{/number}","events_url":"https://api.github.com/repos/alexanderlz/redash/events","assignees_url":"https://api.github.com/repos/alexanderlz/redash/assignees{/user}","branches_url":"https://api.github.com/repos/alexanderlz/redash/branches{/branch}","tags_url":"https://api.github.com/repos/alexanderlz/redash/tags","blobs_url":"https://api.github.com/repos/alexanderlz/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexanderlz/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexanderlz/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexanderlz/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexanderlz/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/alexanderlz/redash/languages","stargazers_url":"https://api.github.com/repos/alexanderlz/redash/stargazers","contributors_url":"https://api.github.com/repos/alexanderlz/redash/contributors","subscribers_url":"https://api.github.com/repos/alexanderlz/redash/subscribers","subscription_url":"https://api.github.com/repos/alexanderlz/redash/subscription","commits_url":"https://api.github.com/repos/alexanderlz/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexanderlz/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexanderlz/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexanderlz/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexanderlz/redash/contents/{+path}","compare_url":"https://api.github.com/repos/alexanderlz/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexanderlz/redash/merges","archive_url":"https://api.github.com/repos/alexanderlz/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexanderlz/redash/downloads","issues_url":"https://api.github.com/repos/alexanderlz/redash/issues{/number}","pulls_url":"https://api.github.com/repos/alexanderlz/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/alexanderlz/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/alexanderlz/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexanderlz/redash/labels{/name}","releases_url":"https://api.github.com/repos/alexanderlz/redash/releases{/id}","deployments_url":"https://api.github.com/repos/alexanderlz/redash/deployments","created_at":"2013-11-03T13:39:29Z","updated_at":"2015-04-19T23:16:34Z","pushed_at":"2016-03-17T11:10:20Z","git_url":"git://github.com/alexanderlz/redash.git","ssh_url":"git@github.com:alexanderlz/redash.git","clone_url":"https://github.com/alexanderlz/redash.git","svn_url":"https://github.com/alexanderlz/redash","homepage":"","size":3613,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"getredash:master","ref":"master","sha":"9e6e91334782923629d8f70bd8957711055b86d0","user":{"login":"getredash","id":10746780,"avatar_url":"https://avatars.githubusercontent.com/u/10746780?v=3","gravatar_id":"","url":"https://api.github.com/users/getredash","html_url":"https://github.com/getredash","followers_url":"https://api.github.com/users/getredash/followers","following_url":"https://api.github.com/users/getredash/following{/other_user}","gists_url":"https://api.github.com/users/getredash/gists{/gist_id}","starred_url":"https://api.github.com/users/getredash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getredash/subscriptions","organizations_url":"https://api.github.com/users/getredash/orgs","repos_url":"https://api.github.com/users/getredash/repos","events_url":"https://api.github.com/users/getredash/events{/privacy}","received_events_url":"https://api.github.com/users/getredash/received_events","type":"Organization","site_admin":false},"repo":{"id":13926404,"name":"redash","full_name":"getredash/redash","owner":{"login":"getredash","id":10746780,"avatar_url":"https://avatars.githubusercontent.com/u/10746780?v=3","gravatar_id":"","url":"https://api.github.com/users/getredash","html_url":"https://github.com/getredash","followers_url":"https://api.github.com/users/getredash/followers","following_url":"https://api.github.com/users/getredash/following{/other_user}","gists_url":"https://api.github.com/users/getredash/gists{/gist_id}","starred_url":"https://api.github.com/users/getredash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getredash/subscriptions","organizations_url":"https://api.github.com/users/getredash/orgs","repos_url":"https://api.github.com/users/getredash/repos","events_url":"https://api.github.com/users/getredash/events{/privacy}","received_events_url":"https://api.github.com/users/getredash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getredash/redash","description":"Make Your Company Data Driven. Connect to any data source, easily visualize and share your data.","fork":false,"url":"https://api.github.com/repos/getredash/redash","forks_url":"https://api.github.com/repos/getredash/redash/forks","keys_url":"https://api.github.com/repos/getredash/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getredash/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getredash/redash/teams","hooks_url":"https://api.github.com/repos/getredash/redash/hooks","issue_events_url":"https://api.github.com/repos/getredash/redash/issues/events{/number}","events_url":"https://api.github.com/repos/getredash/redash/events","assignees_url":"https://api.github.com/repos/getredash/redash/assignees{/user}","branches_url":"https://api.github.com/repos/getredash/redash/branches{/branch}","tags_url":"https://api.github.com/repos/getredash/redash/tags","blobs_url":"https://api.github.com/repos/getredash/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getredash/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getredash/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/getredash/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getredash/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/getredash/redash/languages","stargazers_url":"https://api.github.com/repos/getredash/redash/stargazers","contributors_url":"https://api.github.com/repos/getredash/redash/contributors","subscribers_url":"https://api.github.com/repos/getredash/redash/subscribers","subscription_url":"https://api.github.com/repos/getredash/redash/subscription","commits_url":"https://api.github.com/repos/getredash/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/getredash/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/getredash/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/getredash/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/getredash/redash/contents/{+path}","compare_url":"https://api.github.com/repos/getredash/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getredash/redash/merges","archive_url":"https://api.github.com/repos/getredash/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getredash/redash/downloads","issues_url":"https://api.github.com/repos/getredash/redash/issues{/number}","pulls_url":"https://api.github.com/repos/getredash/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/getredash/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/getredash/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getredash/redash/labels{/name}","releases_url":"https://api.github.com/repos/getredash/redash/releases{/id}","deployments_url":"https://api.github.com/repos/getredash/redash/deployments","created_at":"2013-10-28T13:19:39Z","updated_at":"2016-03-23T07:55:57Z","pushed_at":"2016-03-23T02:18:00Z","git_url":"git://github.com/getredash/redash.git","ssh_url":"git@github.com:getredash/redash.git","clone_url":"https://github.com/getredash/redash.git","svn_url":"https://github.com/getredash/redash","homepage":"http://redash.io/","size":5533,"stargazers_count":1495,"watchers_count":1495,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":253,"mirror_url":null,"open_issues_count":119,"forks":253,"open_issues":119,"watchers":1495,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getredash/redash/pulls/934"},"html":{"href":"https://github.com/getredash/redash/pull/934"},"issue":{"href":"https://api.github.com/repos/getredash/redash/issues/934"},"comments":{"href":"https://api.github.com/repos/getredash/redash/issues/934/comments"},"review_comments":{"href":"https://api.github.com/repos/getredash/redash/pulls/934/comments"},"review_comment":{"href":"https://api.github.com/repos/getredash/redash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getredash/redash/pulls/934/commits"},"statuses":{"href":"https://api.github.com/repos/getredash/redash/statuses/ad95a5eb5e8351b9aa6dc1667ad510e7d912b2b7"}}}}