{"action":"created","issue":{"url":"https://api.github.com/repos/druid-io/druid/issues/2883","repository_url":"https://api.github.com/repos/druid-io/druid","labels_url":"https://api.github.com/repos/druid-io/druid/issues/2883/labels{/name}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/2883/comments","events_url":"https://api.github.com/repos/druid-io/druid/issues/2883/events","html_url":"https://github.com/druid-io/druid/pull/2883","id":151098098,"number":2883,"title":"Finalize fields in postaggs","user":{"login":"CHOIJAEHONG1","id":7674735,"avatar_url":"https://avatars.githubusercontent.com/u/7674735?v=3","gravatar_id":"","url":"https://api.github.com/users/CHOIJAEHONG1","html_url":"https://github.com/CHOIJAEHONG1","followers_url":"https://api.github.com/users/CHOIJAEHONG1/followers","following_url":"https://api.github.com/users/CHOIJAEHONG1/following{/other_user}","gists_url":"https://api.github.com/users/CHOIJAEHONG1/gists{/gist_id}","starred_url":"https://api.github.com/users/CHOIJAEHONG1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CHOIJAEHONG1/subscriptions","organizations_url":"https://api.github.com/users/CHOIJAEHONG1/orgs","repos_url":"https://api.github.com/users/CHOIJAEHONG1/repos","events_url":"https://api.github.com/users/CHOIJAEHONG1/events{/privacy}","received_events_url":"https://api.github.com/users/CHOIJAEHONG1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-26T10:28:31Z","updated_at":"2016-04-26T10:45:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/2883","html_url":"https://github.com/druid-io/druid/pull/2883","diff_url":"https://github.com/druid-io/druid/pull/2883.diff","patch_url":"https://github.com/druid-io/druid/pull/2883.patch"},"body":"According to #2433, automatically finalizing aggregators in a post aggregator sounds really good to druid client programs. \r\nI gave it a try to make it work and it seems good. Now, you can write a query like the below. However, there are some duplicate code blocks here and there. Any comments on refactoring would be welcomed. \r\n```\r\n  \"aggregations\": [\r\n     {\"type\": \"hyperUnique\", \"fieldName\": \"user_unique\", \"name\" : \"user_unique\"}\r\n  ],\r\n  \"postAggregations\" : [\r\n     { \"type\" : \"finalFieldAccess\", \"name\": \"user_unique\", \"fieldName\" : \"user_unique\" }\r\n  ],\r\n```\r\ninstead of\r\n```\r\n  \"aggregations\": [\r\n     {\"type\": \"hyperUnique\", \"fieldName\": \"user_unique\", \"name\" : \"user_unique\"}\r\n  ],\r\n  \"postAggregations\" : [\r\n     { \"type\" : \"hyperUniqueCardinality\", \"name\": \"user_unique\", \"fieldName\" : \"user_unique\" }\r\n  ],\r\n```"},"comment":{"url":"https://api.github.com/repos/druid-io/druid/issues/comments/214699431","html_url":"https://github.com/druid-io/druid/pull/2883#issuecomment-214699431","issue_url":"https://api.github.com/repos/druid-io/druid/issues/2883","id":214699431,"user":{"login":"CHOIJAEHONG1","id":7674735,"avatar_url":"https://avatars.githubusercontent.com/u/7674735?v=3","gravatar_id":"","url":"https://api.github.com/users/CHOIJAEHONG1","html_url":"https://github.com/CHOIJAEHONG1","followers_url":"https://api.github.com/users/CHOIJAEHONG1/followers","following_url":"https://api.github.com/users/CHOIJAEHONG1/following{/other_user}","gists_url":"https://api.github.com/users/CHOIJAEHONG1/gists{/gist_id}","starred_url":"https://api.github.com/users/CHOIJAEHONG1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CHOIJAEHONG1/subscriptions","organizations_url":"https://api.github.com/users/CHOIJAEHONG1/orgs","repos_url":"https://api.github.com/users/CHOIJAEHONG1/repos","events_url":"https://api.github.com/users/CHOIJAEHONG1/events{/privacy}","received_events_url":"https://api.github.com/users/CHOIJAEHONG1/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T10:45:20Z","updated_at":"2016-04-26T10:45:20Z","body":"Uh-oh, there are a lot Ut failures. I will handle them. "}}