{"action":"opened","number":271,"pull_request":{"url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/271","id":82740566,"html_url":"https://github.com/NLPchina/elasticsearch-sql/pull/271","diff_url":"https://github.com/NLPchina/elasticsearch-sql/pull/271.diff","patch_url":"https://github.com/NLPchina/elasticsearch-sql/pull/271.patch","issue_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/271","number":271,"state":"open","locked":false,"title":"fix issuse https://github.com/NLPchina/elasticsearch-sql/issues/265#i…","user":{"login":"allwefantasy","id":797758,"avatar_url":"https://avatars.githubusercontent.com/u/797758?v=3","gravatar_id":"","url":"https://api.github.com/users/allwefantasy","html_url":"https://github.com/allwefantasy","followers_url":"https://api.github.com/users/allwefantasy/followers","following_url":"https://api.github.com/users/allwefantasy/following{/other_user}","gists_url":"https://api.github.com/users/allwefantasy/gists{/gist_id}","starred_url":"https://api.github.com/users/allwefantasy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allwefantasy/subscriptions","organizations_url":"https://api.github.com/users/allwefantasy/orgs","repos_url":"https://api.github.com/users/allwefantasy/repos","events_url":"https://api.github.com/users/allwefantasy/events{/privacy}","received_events_url":"https://api.github.com/users/allwefantasy/received_events","type":"User","site_admin":false},"body":"\r\n## Fix Issue :\r\n\r\n```\r\nhttps://github.com/NLPchina/elasticsearch-sql/issues/265#issuecomment-242388650\r\n```\r\n\r\n## Unit test\r\n\r\n```\r\norg.nlpcn.es4sql.SqlParserTests.aggFieldWithAliasTableAliasShouldBeRemoved\r\n```\r\n\r\n## Example\r\n\r\n```\r\nselect count(t.*) as counts,sum(t.size) from xxx/locs as t group by t.kk\r\n```\r\n\r\nwill be translate to \r\n\r\n```\r\n{\r\n  \"from\" : 0,\r\n  \"size\" : 0,\r\n  \"_source\" : {\r\n    \"includes\" : [ \"COUNT\", \"SUM\" ],\r\n    \"excludes\" : [ ]\r\n  },\r\n  \"aggregations\" : {\r\n    \"kk\" : {\r\n      \"terms\" : {\r\n        \"field\" : \"kk\",\r\n        \"size\" : 200\r\n      },\r\n      \"aggregations\" : {\r\n        \"counts\" : {\r\n          \"value_count\" : {\r\n            \"field\" : \"_index\"\r\n          }\r\n        },\r\n        \"SUM(size)\" : {\r\n          \"sum\" : {\r\n            \"field\" : \"size\"\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```","created_at":"2016-08-25T15:23:41Z","updated_at":"2016-08-25T15:23:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/271/commits","review_comments_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/271/comments","review_comment_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/271/comments","statuses_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/statuses/f86fec5538780e1a547dbb2f1c2f2556df41dcfe","head":{"label":"allwefantasy:master","ref":"master","sha":"f86fec5538780e1a547dbb2f1c2f2556df41dcfe","user":{"login":"allwefantasy","id":797758,"avatar_url":"https://avatars.githubusercontent.com/u/797758?v=3","gravatar_id":"","url":"https://api.github.com/users/allwefantasy","html_url":"https://github.com/allwefantasy","followers_url":"https://api.github.com/users/allwefantasy/followers","following_url":"https://api.github.com/users/allwefantasy/following{/other_user}","gists_url":"https://api.github.com/users/allwefantasy/gists{/gist_id}","starred_url":"https://api.github.com/users/allwefantasy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allwefantasy/subscriptions","organizations_url":"https://api.github.com/users/allwefantasy/orgs","repos_url":"https://api.github.com/users/allwefantasy/repos","events_url":"https://api.github.com/users/allwefantasy/events{/privacy}","received_events_url":"https://api.github.com/users/allwefantasy/received_events","type":"User","site_admin":false},"repo":{"id":66061222,"name":"elasticsearch-sql","full_name":"allwefantasy/elasticsearch-sql","owner":{"login":"allwefantasy","id":797758,"avatar_url":"https://avatars.githubusercontent.com/u/797758?v=3","gravatar_id":"","url":"https://api.github.com/users/allwefantasy","html_url":"https://github.com/allwefantasy","followers_url":"https://api.github.com/users/allwefantasy/followers","following_url":"https://api.github.com/users/allwefantasy/following{/other_user}","gists_url":"https://api.github.com/users/allwefantasy/gists{/gist_id}","starred_url":"https://api.github.com/users/allwefantasy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allwefantasy/subscriptions","organizations_url":"https://api.github.com/users/allwefantasy/orgs","repos_url":"https://api.github.com/users/allwefantasy/repos","events_url":"https://api.github.com/users/allwefantasy/events{/privacy}","received_events_url":"https://api.github.com/users/allwefantasy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allwefantasy/elasticsearch-sql","description":"Use SQL to query Elasticsearch","fork":true,"url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql","forks_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/forks","keys_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/teams","hooks_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/hooks","issue_events_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/issues/events{/number}","events_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/events","assignees_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/assignees{/user}","branches_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/branches{/branch}","tags_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/tags","blobs_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/statuses/{sha}","languages_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/languages","stargazers_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/stargazers","contributors_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/contributors","subscribers_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/subscribers","subscription_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/subscription","commits_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/contents/{+path}","compare_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/merges","archive_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/downloads","issues_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/issues{/number}","pulls_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/pulls{/number}","milestones_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/milestones{/number}","notifications_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/labels{/name}","releases_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/releases{/id}","deployments_url":"https://api.github.com/repos/allwefantasy/elasticsearch-sql/deployments","created_at":"2016-08-19T07:12:40Z","updated_at":"2016-08-19T07:12:42Z","pushed_at":"2016-08-25T15:19:39Z","git_url":"git://github.com/allwefantasy/elasticsearch-sql.git","ssh_url":"git@github.com:allwefantasy/elasticsearch-sql.git","clone_url":"https://github.com/allwefantasy/elasticsearch-sql.git","svn_url":"https://github.com/allwefantasy/elasticsearch-sql","homepage":"","size":5057,"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":"NLPchina:master","ref":"master","sha":"286c84e487c0cf8061411b3d1021f8495d7fd4bb","user":{"login":"NLPchina","id":7099924,"avatar_url":"https://avatars.githubusercontent.com/u/7099924?v=3","gravatar_id":"","url":"https://api.github.com/users/NLPchina","html_url":"https://github.com/NLPchina","followers_url":"https://api.github.com/users/NLPchina/followers","following_url":"https://api.github.com/users/NLPchina/following{/other_user}","gists_url":"https://api.github.com/users/NLPchina/gists{/gist_id}","starred_url":"https://api.github.com/users/NLPchina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NLPchina/subscriptions","organizations_url":"https://api.github.com/users/NLPchina/orgs","repos_url":"https://api.github.com/users/NLPchina/repos","events_url":"https://api.github.com/users/NLPchina/events{/privacy}","received_events_url":"https://api.github.com/users/NLPchina/received_events","type":"Organization","site_admin":false},"repo":{"id":23282991,"name":"elasticsearch-sql","full_name":"NLPchina/elasticsearch-sql","owner":{"login":"NLPchina","id":7099924,"avatar_url":"https://avatars.githubusercontent.com/u/7099924?v=3","gravatar_id":"","url":"https://api.github.com/users/NLPchina","html_url":"https://github.com/NLPchina","followers_url":"https://api.github.com/users/NLPchina/followers","following_url":"https://api.github.com/users/NLPchina/following{/other_user}","gists_url":"https://api.github.com/users/NLPchina/gists{/gist_id}","starred_url":"https://api.github.com/users/NLPchina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NLPchina/subscriptions","organizations_url":"https://api.github.com/users/NLPchina/orgs","repos_url":"https://api.github.com/users/NLPchina/repos","events_url":"https://api.github.com/users/NLPchina/events{/privacy}","received_events_url":"https://api.github.com/users/NLPchina/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NLPchina/elasticsearch-sql","description":"Use SQL to query Elasticsearch","fork":false,"url":"https://api.github.com/repos/NLPchina/elasticsearch-sql","forks_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/forks","keys_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/teams","hooks_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/hooks","issue_events_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/events{/number}","events_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/events","assignees_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/assignees{/user}","branches_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/branches{/branch}","tags_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/tags","blobs_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/git/refs{/sha}","trees_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/statuses/{sha}","languages_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/languages","stargazers_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/stargazers","contributors_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/contributors","subscribers_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/subscribers","subscription_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/subscription","commits_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/commits{/sha}","git_commits_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/git/commits{/sha}","comments_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/comments{/number}","issue_comment_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/comments{/number}","contents_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/contents/{+path}","compare_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/merges","archive_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/downloads","issues_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues{/number}","pulls_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls{/number}","milestones_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/milestones{/number}","notifications_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/labels{/name}","releases_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/releases{/id}","deployments_url":"https://api.github.com/repos/NLPchina/elasticsearch-sql/deployments","created_at":"2014-08-24T14:26:31Z","updated_at":"2016-08-25T15:04:09Z","pushed_at":"2016-08-25T08:40:22Z","git_url":"git://github.com/NLPchina/elasticsearch-sql.git","ssh_url":"git@github.com:NLPchina/elasticsearch-sql.git","clone_url":"https://github.com/NLPchina/elasticsearch-sql.git","svn_url":"https://github.com/NLPchina/elasticsearch-sql","homepage":"","size":5376,"stargazers_count":1578,"watchers_count":1578,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":309,"mirror_url":null,"open_issues_count":80,"forks":309,"open_issues":80,"watchers":1578,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/271"},"html":{"href":"https://github.com/NLPchina/elasticsearch-sql/pull/271"},"issue":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/271"},"comments":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/issues/271/comments"},"review_comments":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/271/comments"},"review_comment":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/pulls/271/commits"},"statuses":{"href":"https://api.github.com/repos/NLPchina/elasticsearch-sql/statuses/f86fec5538780e1a547dbb2f1c2f2556df41dcfe"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":126,"deletions":94,"changed_files":6}}
{"actor":{"display_login":"allwefantasy"}}