{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/236007871","pull_request_review_id":178011085,"id":236007871,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjAwNzg3MQ==","diff_hunk":"@@ -0,0 +1,111 @@\n+/*\n+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n+ * or more contributor license agreements. Licensed under the Elastic License;\n+ * you may not use this file except in compliance with the Elastic License.\n+ */\n+package org.elasticsearch.xpack.sql.plan.logical.command.sys;\n+\n+import org.elasticsearch.common.collect.Tuple;\n+import org.elasticsearch.test.ESTestCase;\n+import org.elasticsearch.xpack.sql.analysis.analyzer.Analyzer;\n+import org.elasticsearch.xpack.sql.analysis.index.EsIndex;\n+import org.elasticsearch.xpack.sql.analysis.index.IndexResolution;\n+import org.elasticsearch.xpack.sql.analysis.index.IndexResolver;\n+import org.elasticsearch.xpack.sql.expression.function.FunctionRegistry;\n+import org.elasticsearch.xpack.sql.parser.SqlParser;\n+import org.elasticsearch.xpack.sql.plan.logical.command.Command;\n+import org.elasticsearch.xpack.sql.session.SqlSession;\n+import org.elasticsearch.xpack.sql.type.DataType;\n+import org.elasticsearch.xpack.sql.type.TypesTests;\n+\n+import java.sql.JDBCType;\n+import java.util.List;\n+import java.util.TimeZone;\n+\n+import static java.util.Arrays.asList;\n+import static org.elasticsearch.action.ActionListener.wrap;\n+import static org.mockito.Mockito.mock;\n+\n+public class SysTypesTests extends ESTestCase {\n+\n+    private final SqlParser parser = new SqlParser();\n+\n+    private Tuple<Command, SqlSession> sql(String sql) {\n+        EsIndex test = new EsIndex(\"test\", TypesTests.loadMapping(\"mapping-multi-field-with-nested.json\", true));\n+        Analyzer analyzer = new Analyzer(new FunctionRegistry(), IndexResolution.valid(test), TimeZone.getTimeZone(\"UTC\"));\n+        Command cmd = (Command) analyzer.analyze(parser.createStatement(sql), true);\n+\n+        IndexResolver resolver = mock(IndexResolver.class);\n+        SqlSession session = new SqlSession(null, null, null, resolver, null, null, null);\n+        return new Tuple<>(cmd, session);\n+    }\n+\n+    public void testSysTypes() throws Exception {\n+        Command cmd = sql(\"SYS TYPES\").v1();\n+\n+        List<String> names = asList(\"BYTE\", \"LONG\", \"BINARY\", \"NULL\", \"INTEGER\", \"SHORT\", \"HALF_FLOAT\", \"SCALED_FLOAT\", \"FLOAT\", \"DOUBLE\",","path":"x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plan/logical/command/sys/SysTypesTests.java","position":46,"original_position":46,"commit_id":"b6a6995ead0d1f78f32ac7c93fdc2f562fb66897","original_commit_id":"b6a6995ead0d1f78f32ac7c93fdc2f562fb66897","user":{"login":"costin","id":76245,"node_id":"MDQ6VXNlcjc2MjQ1","avatar_url":"https://avatars3.githubusercontent.com/u/76245?v=4","gravatar_id":"","url":"https://api.github.com/users/costin","html_url":"https://github.com/costin","followers_url":"https://api.github.com/users/costin/followers","following_url":"https://api.github.com/users/costin/following{/other_user}","gists_url":"https://api.github.com/users/costin/gists{/gist_id}","starred_url":"https://api.github.com/users/costin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costin/subscriptions","organizations_url":"https://api.github.com/users/costin/orgs","repos_url":"https://api.github.com/users/costin/repos","events_url":"https://api.github.com/users/costin/events{/privacy}","received_events_url":"https://api.github.com/users/costin/received_events","type":"User","site_admin":false},"body":"Because the order is different than that of the enum declaration. We could add sorting to it but then it would be the same logic as the one in the code and I wanted to check that manually.","created_at":"2018-11-23T19:03:59Z","updated_at":"2018-11-23T19:03:59Z","html_url":"https://github.com/elastic/elasticsearch/pull/35852#discussion_r236007871","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/236007871"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/35852#discussion_r236007871"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852"}},"in_reply_to_id":236006283},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852","id":233177866,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMTc3ODY2","html_url":"https://github.com/elastic/elasticsearch/pull/35852","diff_url":"https://github.com/elastic/elasticsearch/pull/35852.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/35852.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/35852","number":35852,"state":"open","locked":false,"title":"SQL: Add filtering to SYS TYPES","user":{"login":"costin","id":76245,"node_id":"MDQ6VXNlcjc2MjQ1","avatar_url":"https://avatars3.githubusercontent.com/u/76245?v=4","gravatar_id":"","url":"https://api.github.com/users/costin","html_url":"https://github.com/costin","followers_url":"https://api.github.com/users/costin/followers","following_url":"https://api.github.com/users/costin/following{/other_user}","gists_url":"https://api.github.com/users/costin/gists{/gist_id}","starred_url":"https://api.github.com/users/costin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costin/subscriptions","organizations_url":"https://api.github.com/users/costin/orgs","repos_url":"https://api.github.com/users/costin/repos","events_url":"https://api.github.com/users/costin/events{/privacy}","received_events_url":"https://api.github.com/users/costin/received_events","type":"User","site_admin":false},"body":"Fix #35242","created_at":"2018-11-23T11:47:44Z","updated_at":"2018-11-23T19:03:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"214d10bf60b5602d1061e7303a9c59e2e6f20b47","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":912794284,"node_id":"MDU6TGFiZWw5MTI3OTQyODQ=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Search/SQL","name":":Search/SQL","color":"0e8a16","default":false},{"id":23174,"node_id":"MDU6TGFiZWwyMzE3NA==","url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Eenhancement","name":">enhancement","color":"4a4ea8","default":false},{"id":1102494662,"node_id":"MDU6TGFiZWwxMTAyNDk0NjYy","url":"https://api.github.com/repos/elastic/elasticsearch/labels/v6.6.0","name":"v6.6.0","color":"dddddd","default":false},{"id":484855464,"node_id":"MDU6TGFiZWw0ODQ4NTU0NjQ=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/v7.0.0","name":"v7.0.0","color":"dddddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/35852/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/b6a6995ead0d1f78f32ac7c93fdc2f562fb66897","head":{"label":"costin:fix-35342","ref":"fix-35342","sha":"b6a6995ead0d1f78f32ac7c93fdc2f562fb66897","user":{"login":"costin","id":76245,"node_id":"MDQ6VXNlcjc2MjQ1","avatar_url":"https://avatars3.githubusercontent.com/u/76245?v=4","gravatar_id":"","url":"https://api.github.com/users/costin","html_url":"https://github.com/costin","followers_url":"https://api.github.com/users/costin/followers","following_url":"https://api.github.com/users/costin/following{/other_user}","gists_url":"https://api.github.com/users/costin/gists{/gist_id}","starred_url":"https://api.github.com/users/costin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costin/subscriptions","organizations_url":"https://api.github.com/users/costin/orgs","repos_url":"https://api.github.com/users/costin/repos","events_url":"https://api.github.com/users/costin/events{/privacy}","received_events_url":"https://api.github.com/users/costin/received_events","type":"User","site_admin":false},"repo":{"id":12863902,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg2MzkwMg==","name":"elasticsearch","full_name":"costin/elasticsearch","private":false,"owner":{"login":"costin","id":76245,"node_id":"MDQ6VXNlcjc2MjQ1","avatar_url":"https://avatars3.githubusercontent.com/u/76245?v=4","gravatar_id":"","url":"https://api.github.com/users/costin","html_url":"https://github.com/costin","followers_url":"https://api.github.com/users/costin/followers","following_url":"https://api.github.com/users/costin/following{/other_user}","gists_url":"https://api.github.com/users/costin/gists{/gist_id}","starred_url":"https://api.github.com/users/costin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costin/subscriptions","organizations_url":"https://api.github.com/users/costin/orgs","repos_url":"https://api.github.com/users/costin/repos","events_url":"https://api.github.com/users/costin/events{/privacy}","received_events_url":"https://api.github.com/users/costin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/costin/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/costin/elasticsearch","forks_url":"https://api.github.com/repos/costin/elasticsearch/forks","keys_url":"https://api.github.com/repos/costin/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/costin/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/costin/elasticsearch/teams","hooks_url":"https://api.github.com/repos/costin/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/costin/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/costin/elasticsearch/events","assignees_url":"https://api.github.com/repos/costin/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/costin/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/costin/elasticsearch/tags","blobs_url":"https://api.github.com/repos/costin/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/costin/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/costin/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/costin/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/costin/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/costin/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/costin/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/costin/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/costin/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/costin/elasticsearch/subscription","commits_url":"https://api.github.com/repos/costin/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/costin/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/costin/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/costin/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/costin/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/costin/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/costin/elasticsearch/merges","archive_url":"https://api.github.com/repos/costin/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/costin/elasticsearch/downloads","issues_url":"https://api.github.com/repos/costin/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/costin/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/costin/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/costin/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/costin/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/costin/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/costin/elasticsearch/deployments","created_at":"2013-09-16T09:51:43Z","updated_at":"2018-09-13T18:56:16Z","pushed_at":"2018-11-23T15:43:03Z","git_url":"git://github.com/costin/elasticsearch.git","ssh_url":"git@github.com:costin/elasticsearch.git","clone_url":"https://github.com/costin/elasticsearch.git","svn_url":"https://github.com/costin/elasticsearch","homepage":"http://elasticsearch.org","size":413250,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"e22a83554eb0bba81e3f7e1b3f353a243fac0c7b","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"node_id":"MDEwOlJlcG9zaXRvcnk1MDc3NzU=","name":"elasticsearch","full_name":"elastic/elasticsearch","private":false,"owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2018-11-23T17:32:13Z","pushed_at":"2018-11-23T18:59:59Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":533585,"stargazers_count":36249,"watchers_count":36249,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12253,"mirror_url":null,"archived":false,"open_issues_count":1824,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":12253,"open_issues":1824,"watchers":36249,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/35852"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/35852"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/35852/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/35852/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/b6a6995ead0d1f78f32ac7c93fdc2f562fb66897"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"costin"}}