{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/71453503","id":71453503,"diff_hunk":"@@ -0,0 +1,76 @@\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package com.facebook.presto.hive;\n+\n+import com.facebook.presto.spi.type.Type;\n+import com.facebook.presto.spi.type.TypeManager;\n+import com.facebook.presto.type.TypeRegistry;\n+import com.google.common.collect.ImmutableMap;\n+import org.testng.annotations.Test;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import static com.facebook.presto.spi.type.TypeSignature.parseTypeSignature;\n+import static java.util.Objects.requireNonNull;\n+import static org.testng.Assert.assertEquals;\n+\n+public class TestHiveTypeTranslator\n+{\n+    private final TypeManager typeManager;\n+    private final TypeTranslator typeTranslator;\n+\n+    private final Map<String, HiveType> typeTranslationMap;\n+\n+    public TestHiveTypeTranslator()\n+    {\n+        this(new HiveTypeTranslator(), ImmutableMap.of());\n+    }\n+\n+    protected TestHiveTypeTranslator(TypeTranslator typeTranslator, Map<String, HiveType> overwriteTranslation)\n+    {\n+        this.typeManager = new TypeRegistry();\n+        this.typeTranslator = requireNonNull(typeTranslator, \"typeTranslator is null\");\n+\n+        ImmutableMap<String, HiveType> hiveTypeTranslationMap = ImmutableMap.<String, HiveType>builder()\n+                .put(\"bigint\", HiveType.HIVE_LONG)\n+                .put(\"integer\", HiveType.HIVE_INT)\n+                .put(\"smallint\", HiveType.HIVE_SHORT)\n+                .put(\"tinyint\", HiveType.HIVE_BYTE)\n+                .put(\"varchar(3)\", HiveType.valueOf(\"varchar(3)\"))","path":"presto-hive/src/test/java/com/facebook/presto/hive/TestHiveTypeTranslator.java","position":51,"original_position":51,"commit_id":"83b834b52d30d65af98c6b968551d5c4947a413a","original_commit_id":"83b834b52d30d65af98c6b968551d5c4947a413a","user":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"body":"add `double` and `varbinary`","created_at":"2016-07-20T01:37:31Z","updated_at":"2016-07-20T01:37:31Z","html_url":"https://github.com/prestodb/presto/pull/5704#discussion_r71453503","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/5704","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/71453503"},"html":{"href":"https://github.com/prestodb/presto/pull/5704#discussion_r71453503"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5704"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/5704","id":78074128,"html_url":"https://github.com/prestodb/presto/pull/5704","diff_url":"https://github.com/prestodb/presto/pull/5704.diff","patch_url":"https://github.com/prestodb/presto/pull/5704.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5704","number":5704,"state":"open","locked":false,"title":"Add test for TypeTranslator in Hive connector","user":{"login":"geraint0923","id":923382,"avatar_url":"https://avatars.githubusercontent.com/u/923382?v=3","gravatar_id":"","url":"https://api.github.com/users/geraint0923","html_url":"https://github.com/geraint0923","followers_url":"https://api.github.com/users/geraint0923/followers","following_url":"https://api.github.com/users/geraint0923/following{/other_user}","gists_url":"https://api.github.com/users/geraint0923/gists{/gist_id}","starred_url":"https://api.github.com/users/geraint0923/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraint0923/subscriptions","organizations_url":"https://api.github.com/users/geraint0923/orgs","repos_url":"https://api.github.com/users/geraint0923/repos","events_url":"https://api.github.com/users/geraint0923/events{/privacy}","received_events_url":"https://api.github.com/users/geraint0923/received_events","type":"User","site_admin":false},"body":"Also update the integration test to fit TypeTranslator.","created_at":"2016-07-20T01:08:44Z","updated_at":"2016-07-20T01:37:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d955e6be4c16ecd66035dd399b24d2c8bfdf8412","assignee":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"assignees":[{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/5704/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/5704/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5704/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/83b834b52d30d65af98c6b968551d5c4947a413a","head":{"label":"geraint0923:fix_translator","ref":"fix_translator","sha":"83b834b52d30d65af98c6b968551d5c4947a413a","user":{"login":"geraint0923","id":923382,"avatar_url":"https://avatars.githubusercontent.com/u/923382?v=3","gravatar_id":"","url":"https://api.github.com/users/geraint0923","html_url":"https://github.com/geraint0923","followers_url":"https://api.github.com/users/geraint0923/followers","following_url":"https://api.github.com/users/geraint0923/following{/other_user}","gists_url":"https://api.github.com/users/geraint0923/gists{/gist_id}","starred_url":"https://api.github.com/users/geraint0923/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraint0923/subscriptions","organizations_url":"https://api.github.com/users/geraint0923/orgs","repos_url":"https://api.github.com/users/geraint0923/repos","events_url":"https://api.github.com/users/geraint0923/events{/privacy}","received_events_url":"https://api.github.com/users/geraint0923/received_events","type":"User","site_admin":false},"repo":{"id":52384465,"name":"presto","full_name":"geraint0923/presto","owner":{"login":"geraint0923","id":923382,"avatar_url":"https://avatars.githubusercontent.com/u/923382?v=3","gravatar_id":"","url":"https://api.github.com/users/geraint0923","html_url":"https://github.com/geraint0923","followers_url":"https://api.github.com/users/geraint0923/followers","following_url":"https://api.github.com/users/geraint0923/following{/other_user}","gists_url":"https://api.github.com/users/geraint0923/gists{/gist_id}","starred_url":"https://api.github.com/users/geraint0923/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraint0923/subscriptions","organizations_url":"https://api.github.com/users/geraint0923/orgs","repos_url":"https://api.github.com/users/geraint0923/repos","events_url":"https://api.github.com/users/geraint0923/events{/privacy}","received_events_url":"https://api.github.com/users/geraint0923/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geraint0923/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/geraint0923/presto","forks_url":"https://api.github.com/repos/geraint0923/presto/forks","keys_url":"https://api.github.com/repos/geraint0923/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geraint0923/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geraint0923/presto/teams","hooks_url":"https://api.github.com/repos/geraint0923/presto/hooks","issue_events_url":"https://api.github.com/repos/geraint0923/presto/issues/events{/number}","events_url":"https://api.github.com/repos/geraint0923/presto/events","assignees_url":"https://api.github.com/repos/geraint0923/presto/assignees{/user}","branches_url":"https://api.github.com/repos/geraint0923/presto/branches{/branch}","tags_url":"https://api.github.com/repos/geraint0923/presto/tags","blobs_url":"https://api.github.com/repos/geraint0923/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geraint0923/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geraint0923/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/geraint0923/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geraint0923/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/geraint0923/presto/languages","stargazers_url":"https://api.github.com/repos/geraint0923/presto/stargazers","contributors_url":"https://api.github.com/repos/geraint0923/presto/contributors","subscribers_url":"https://api.github.com/repos/geraint0923/presto/subscribers","subscription_url":"https://api.github.com/repos/geraint0923/presto/subscription","commits_url":"https://api.github.com/repos/geraint0923/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/geraint0923/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/geraint0923/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/geraint0923/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/geraint0923/presto/contents/{+path}","compare_url":"https://api.github.com/repos/geraint0923/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geraint0923/presto/merges","archive_url":"https://api.github.com/repos/geraint0923/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geraint0923/presto/downloads","issues_url":"https://api.github.com/repos/geraint0923/presto/issues{/number}","pulls_url":"https://api.github.com/repos/geraint0923/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/geraint0923/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/geraint0923/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geraint0923/presto/labels{/name}","releases_url":"https://api.github.com/repos/geraint0923/presto/releases{/id}","deployments_url":"https://api.github.com/repos/geraint0923/presto/deployments","created_at":"2016-02-23T19:10:55Z","updated_at":"2016-02-23T19:11:06Z","pushed_at":"2016-07-20T01:07:16Z","git_url":"git://github.com/geraint0923/presto.git","ssh_url":"git@github.com:geraint0923/presto.git","clone_url":"https://github.com/geraint0923/presto.git","svn_url":"https://github.com/geraint0923/presto","homepage":"https://prestodb.io","size":64995,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"58283b2a77b7d1dc7468ad6b3e269a7aa0ee88cd","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-07-19T17:51:46Z","pushed_at":"2016-07-20T01:27:55Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":158184,"stargazers_count":4929,"watchers_count":4929,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1482,"mirror_url":null,"open_issues_count":611,"forks":1482,"open_issues":611,"watchers":4929,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5704"},"html":{"href":"https://github.com/prestodb/presto/pull/5704"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/5704"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/5704/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5704/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5704/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/83b834b52d30d65af98c6b968551d5c4947a413a"}}}}
{"actor":{"display_login":"haozhun"}}