{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/53408107","id":53408107,"diff_hunk":"@@ -0,0 +1,94 @@\n+/*\n+ * Licensed to Metamarkets Group Inc. (Metamarkets) under one\n+ * or more contributor license agreements. See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership. Metamarkets licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License. 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,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package io.druid.data.input.parquet;\n+\n+import com.google.api.client.util.Lists;\n+import com.google.api.client.util.Sets;\n+import io.druid.data.input.InputRow;\n+import io.druid.indexer.HadoopDruidIndexerConfig;\n+import io.druid.query.aggregation.AggregatorFactory;\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.parquet.hadoop.api.InitContext;\n+import org.apache.parquet.hadoop.api.ReadSupport;\n+import org.apache.parquet.io.api.RecordMaterializer;\n+import org.apache.parquet.schema.MessageType;\n+import org.apache.parquet.schema.Type;\n+\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+\n+/**\n+ * `copy` from parquet-hadoop examples\n+ *\n+ * read only \"ts + dimensions + metric\"\n+ */\n+public class InputRowReadSupport extends ReadSupport<InputRow>\n+{\n+\n+  private MessageType getPartialReadSchema(InitContext context)\n+  {\n+    MessageType fullSchema = context.getFileSchema();\n+\n+    String name = fullSchema.getName();\n+\n+    HadoopDruidIndexerConfig config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration());\n+    String tsField = config.getParser().getParseSpec().getTimestampSpec().getTimestampColumn();\n+    List<String> dimensions = config.getParser().getParseSpec().getDimensionsSpec().getDimensions();\n+    Set<String> metricsFields = Sets.newHashSet();\n+    for (AggregatorFactory agg : config.getSchema().getDataSchema().getAggregators()) {\n+      if (!agg.getName().equals(\"count\")) {\n+        metricsFields.add(agg.getName());","path":"extensions/parquet-extensions/src/main/java/io/druid/data/input/parquet/InputRowReadSupport.java","position":58,"original_position":58,"commit_id":"da9113613a4b8aabc46b4c77f55803f4bfd9b8e3","original_commit_id":"da9113613a4b8aabc46b4c77f55803f4bfd9b8e3","user":{"login":"himanshug","id":246308,"avatar_url":"https://avatars.githubusercontent.com/u/246308?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshug","html_url":"https://github.com/himanshug","followers_url":"https://api.github.com/users/himanshug/followers","following_url":"https://api.github.com/users/himanshug/following{/other_user}","gists_url":"https://api.github.com/users/himanshug/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshug/subscriptions","organizations_url":"https://api.github.com/users/himanshug/orgs","repos_url":"https://api.github.com/users/himanshug/repos","events_url":"https://api.github.com/users/himanshug/events{/privacy}","received_events_url":"https://api.github.com/users/himanshug/received_events","type":"User","site_admin":false},"body":"agg.getName() may not match with the field aggregator is looking for. actually in all this you probably want to use AggregatorFactory.requiredFields() instead.","created_at":"2016-02-19T00:48:49Z","updated_at":"2016-02-19T00:48:49Z","html_url":"https://github.com/druid-io/druid/pull/2369#discussion_r53408107","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/2369","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/53408107"},"html":{"href":"https://github.com/druid-io/druid/pull/2369#discussion_r53408107"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2369"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/2369","id":58015295,"html_url":"https://github.com/druid-io/druid/pull/2369","diff_url":"https://github.com/druid-io/druid/pull/2369.diff","patch_url":"https://github.com/druid-io/druid/pull/2369.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/2369","number":2369,"state":"open","locked":false,"title":"[Feature] Extension: Offline Ingestion with limited Parquet Support","user":{"login":"du00cs","id":6407028,"avatar_url":"https://avatars.githubusercontent.com/u/6407028?v=3","gravatar_id":"","url":"https://api.github.com/users/du00cs","html_url":"https://github.com/du00cs","followers_url":"https://api.github.com/users/du00cs/followers","following_url":"https://api.github.com/users/du00cs/following{/other_user}","gists_url":"https://api.github.com/users/du00cs/gists{/gist_id}","starred_url":"https://api.github.com/users/du00cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/du00cs/subscriptions","organizations_url":"https://api.github.com/users/du00cs/orgs","repos_url":"https://api.github.com/users/du00cs/repos","events_url":"https://api.github.com/users/du00cs/events{/privacy}","received_events_url":"https://api.github.com/users/du00cs/received_events","type":"User","site_admin":false},"body":"Changes for proposal #2333 \r\n\r\nImplemented:\r\n1. limited primitive types support for dimensions (`int/long/boolean/string => string`) and metrics (`double/float/int/long`)\r\n2. parquet column filter support i.e. read only dimensions, metrics and timestamp fields\r\n3. list type support\r\n\r\nLocal Hadoop Test Passed.\r\n\r\nTODO\r\n1. add license\r\n2. add docs","created_at":"2016-02-02T16:52:01Z","updated_at":"2016-02-19T00:48:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"893f38e7a6278d33938cc419c94da021692145ab","assignee":null,"milestone":{"url":"https://api.github.com/repos/druid-io/druid/milestones/18","html_url":"https://github.com/druid-io/druid/milestones/0.9.1","labels_url":"https://api.github.com/repos/druid-io/druid/milestones/18/labels","id":1526819,"number":18,"title":"0.9.1","description":"","creator":{"login":"fjy","id":428325,"avatar_url":"https://avatars.githubusercontent.com/u/428325?v=3","gravatar_id":"","url":"https://api.github.com/users/fjy","html_url":"https://github.com/fjy","followers_url":"https://api.github.com/users/fjy/followers","following_url":"https://api.github.com/users/fjy/following{/other_user}","gists_url":"https://api.github.com/users/fjy/gists{/gist_id}","starred_url":"https://api.github.com/users/fjy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjy/subscriptions","organizations_url":"https://api.github.com/users/fjy/orgs","repos_url":"https://api.github.com/users/fjy/repos","events_url":"https://api.github.com/users/fjy/events{/privacy}","received_events_url":"https://api.github.com/users/fjy/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":9,"state":"open","created_at":"2016-01-20T19:04:22Z","updated_at":"2016-02-18T23:58:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/2369/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/2369/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/2369/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/da9113613a4b8aabc46b4c77f55803f4bfd9b8e3","head":{"label":"du00cs:master","ref":"master","sha":"da9113613a4b8aabc46b4c77f55803f4bfd9b8e3","user":{"login":"du00cs","id":6407028,"avatar_url":"https://avatars.githubusercontent.com/u/6407028?v=3","gravatar_id":"","url":"https://api.github.com/users/du00cs","html_url":"https://github.com/du00cs","followers_url":"https://api.github.com/users/du00cs/followers","following_url":"https://api.github.com/users/du00cs/following{/other_user}","gists_url":"https://api.github.com/users/du00cs/gists{/gist_id}","starred_url":"https://api.github.com/users/du00cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/du00cs/subscriptions","organizations_url":"https://api.github.com/users/du00cs/orgs","repos_url":"https://api.github.com/users/du00cs/repos","events_url":"https://api.github.com/users/du00cs/events{/privacy}","received_events_url":"https://api.github.com/users/du00cs/received_events","type":"User","site_admin":false},"repo":{"id":50505627,"name":"druid","full_name":"du00cs/druid","owner":{"login":"du00cs","id":6407028,"avatar_url":"https://avatars.githubusercontent.com/u/6407028?v=3","gravatar_id":"","url":"https://api.github.com/users/du00cs","html_url":"https://github.com/du00cs","followers_url":"https://api.github.com/users/du00cs/followers","following_url":"https://api.github.com/users/du00cs/following{/other_user}","gists_url":"https://api.github.com/users/du00cs/gists{/gist_id}","starred_url":"https://api.github.com/users/du00cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/du00cs/subscriptions","organizations_url":"https://api.github.com/users/du00cs/orgs","repos_url":"https://api.github.com/users/du00cs/repos","events_url":"https://api.github.com/users/du00cs/events{/privacy}","received_events_url":"https://api.github.com/users/du00cs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/du00cs/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":true,"url":"https://api.github.com/repos/du00cs/druid","forks_url":"https://api.github.com/repos/du00cs/druid/forks","keys_url":"https://api.github.com/repos/du00cs/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/du00cs/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/du00cs/druid/teams","hooks_url":"https://api.github.com/repos/du00cs/druid/hooks","issue_events_url":"https://api.github.com/repos/du00cs/druid/issues/events{/number}","events_url":"https://api.github.com/repos/du00cs/druid/events","assignees_url":"https://api.github.com/repos/du00cs/druid/assignees{/user}","branches_url":"https://api.github.com/repos/du00cs/druid/branches{/branch}","tags_url":"https://api.github.com/repos/du00cs/druid/tags","blobs_url":"https://api.github.com/repos/du00cs/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/du00cs/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/du00cs/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/du00cs/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/du00cs/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/du00cs/druid/languages","stargazers_url":"https://api.github.com/repos/du00cs/druid/stargazers","contributors_url":"https://api.github.com/repos/du00cs/druid/contributors","subscribers_url":"https://api.github.com/repos/du00cs/druid/subscribers","subscription_url":"https://api.github.com/repos/du00cs/druid/subscription","commits_url":"https://api.github.com/repos/du00cs/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/du00cs/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/du00cs/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/du00cs/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/du00cs/druid/contents/{+path}","compare_url":"https://api.github.com/repos/du00cs/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/du00cs/druid/merges","archive_url":"https://api.github.com/repos/du00cs/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/du00cs/druid/downloads","issues_url":"https://api.github.com/repos/du00cs/druid/issues{/number}","pulls_url":"https://api.github.com/repos/du00cs/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/du00cs/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/du00cs/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/du00cs/druid/labels{/name}","releases_url":"https://api.github.com/repos/du00cs/druid/releases{/id}","deployments_url":"https://api.github.com/repos/du00cs/druid/deployments","created_at":"2016-01-27T12:25:27Z","updated_at":"2016-01-27T12:25:33Z","pushed_at":"2016-02-17T06:15:40Z","git_url":"git://github.com/du00cs/druid.git","ssh_url":"git@github.com:du00cs/druid.git","clone_url":"https://github.com/du00cs/druid.git","svn_url":"https://github.com/du00cs/druid","homepage":"http://druid.io","size":105925,"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":"druid-io:master","ref":"master","sha":"083f019a4807e810e6d801b487e1324b36f09c77","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","deployments_url":"https://api.github.com/repos/druid-io/druid/deployments","created_at":"2012-10-23T19:08:07Z","updated_at":"2016-02-18T20:10:40Z","pushed_at":"2016-02-18T23:57:33Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":126347,"stargazers_count":2455,"watchers_count":2455,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":582,"mirror_url":null,"open_issues_count":337,"forks":582,"open_issues":337,"watchers":2455,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2369"},"html":{"href":"https://github.com/druid-io/druid/pull/2369"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/2369"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/2369/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2369/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2369/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/da9113613a4b8aabc46b4c77f55803f4bfd9b8e3"}}}}