{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/26259102","id":26259102,"diff_hunk":"@@ -83,6 +92,47 @@ protected void map(\n     }\n   }\n \n-  abstract protected void innerMap(InputRow inputRow, Text text, Context context)\n+  public final static InputRow parseInputRow(Writable value, InputRowParser parser)\n+  {\n+    if(value instanceof Text) {\n+      //Note: this hack is required because StringInputRowParser is a\n+      //InputRowParser<ByteBuffer> and not InputRowParser<String>\n+      //parse() method on it expects a ByteBuffer and not String\n+      ByteBuffer bb = ByteBuffer.wrap(value.toString().getBytes());\n+      return parser.parse(bb);","path":"indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerMapper.java","position":null,"original_position":72,"commit_id":"916e35e04c5e5cd1aac7cd9e9355b2f3d8c6357a","original_commit_id":"f450a89a0707e0523a0e8bb77f269b003b63a007","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":"added the check","created_at":"2015-03-11T21:44:59Z","updated_at":"2015-03-11T21:44:59Z","html_url":"https://github.com/druid-io/druid/pull/1177#discussion_r26259102","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/1177","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/26259102"},"html":{"href":"https://github.com/druid-io/druid/pull/1177#discussion_r26259102"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1177"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/1177","id":30705692,"html_url":"https://github.com/druid-io/druid/pull/1177","diff_url":"https://github.com/druid-io/druid/pull/1177.diff","patch_url":"https://github.com/druid-io/druid/pull/1177.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/1177","number":1177,"state":"open","locked":false,"title":"Proposal: feature to make hadoop input format configurable for batch ingestion","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":"Our hadooop batch pipelines mostly store data using avro input format. Currently we need to run additional jobs just to convert avro data into text(csv/json/tsv) so that it can be ingested into druid. This is really not necessary. We can save those hadoop grid resources and additional jobs by letting users specify their own hadoop input format for the batch ingestion to druid.\r\n\r\nThis patch enables additional parameter inside hadoop ioConfig as following..\r\n```\r\n \"ioConfig\" : {\r\n    \"type\" : \"hadoop\",\r\n    \"inputSpec\" : {\r\n      \"type\" : \"static\",\r\n      \"paths\" : \"/MyDirectory/examples/indexing/wikipedia_data.json\",\r\n      \"inputFormat\": \"com.xyz.hadoop.MyAvroToTextInputFormat\"\r\n    }\r\n```\r\n\r\n\r\nIt is required that user supplied InputFormat reads input data location from \"mapreduce.input.fileinputformat.inputdir\" in the job configuration.\r\n\r\nIn addition to that, it will have one of the following constraints.\r\n\r\nOption#1:  Records returned by user InputFormat have Text value. Text values are structured into json or csv or tsv etc.\r\n\r\nThis one is simplest to implement with least number of changes.\r\n\r\nOption#2: Records returned by user InputFormat have Text or MapWritable value. For MapWritable, they will need to configure \"map\" input row parser.\r\n\r\nOption#3: InputFormat can return any Writable value, but user is required to provide a custom InputRowParser implementation that can convert the records returned by supplied InputFormat  to druid InputRow. \r\n\r\n\r\nWe are implementing Option#3 .\r\n","created_at":"2015-03-07T17:02:55Z","updated_at":"2015-03-11T21:44:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3cd04f5f6de63f2f96e4788a0ee370b5ec2960fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/1177/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/1177/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/1177/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/916e35e04c5e5cd1aac7cd9e9355b2f3d8c6357a","head":{"label":"himanshug:custom_input_format1","ref":"custom_input_format1","sha":"916e35e04c5e5cd1aac7cd9e9355b2f3d8c6357a","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},"repo":{"id":23076411,"name":"druid","full_name":"himanshug/druid","owner":{"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},"private":false,"html_url":"https://github.com/himanshug/druid","description":"Real²time Exploratory Analytics on Large Datasets","fork":true,"url":"https://api.github.com/repos/himanshug/druid","forks_url":"https://api.github.com/repos/himanshug/druid/forks","keys_url":"https://api.github.com/repos/himanshug/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/himanshug/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/himanshug/druid/teams","hooks_url":"https://api.github.com/repos/himanshug/druid/hooks","issue_events_url":"https://api.github.com/repos/himanshug/druid/issues/events{/number}","events_url":"https://api.github.com/repos/himanshug/druid/events","assignees_url":"https://api.github.com/repos/himanshug/druid/assignees{/user}","branches_url":"https://api.github.com/repos/himanshug/druid/branches{/branch}","tags_url":"https://api.github.com/repos/himanshug/druid/tags","blobs_url":"https://api.github.com/repos/himanshug/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/himanshug/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/himanshug/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/himanshug/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/himanshug/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/himanshug/druid/languages","stargazers_url":"https://api.github.com/repos/himanshug/druid/stargazers","contributors_url":"https://api.github.com/repos/himanshug/druid/contributors","subscribers_url":"https://api.github.com/repos/himanshug/druid/subscribers","subscription_url":"https://api.github.com/repos/himanshug/druid/subscription","commits_url":"https://api.github.com/repos/himanshug/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/himanshug/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/himanshug/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/himanshug/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/himanshug/druid/contents/{+path}","compare_url":"https://api.github.com/repos/himanshug/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/himanshug/druid/merges","archive_url":"https://api.github.com/repos/himanshug/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/himanshug/druid/downloads","issues_url":"https://api.github.com/repos/himanshug/druid/issues{/number}","pulls_url":"https://api.github.com/repos/himanshug/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/himanshug/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/himanshug/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/himanshug/druid/labels{/name}","releases_url":"https://api.github.com/repos/himanshug/druid/releases{/id}","created_at":"2014-08-18T15:28:53Z","updated_at":"2015-02-23T20:08:38Z","pushed_at":"2015-03-11T17:59:20Z","git_url":"git://github.com/himanshug/druid.git","ssh_url":"git@github.com:himanshug/druid.git","clone_url":"https://github.com/himanshug/druid.git","svn_url":"https://github.com/himanshug/druid","homepage":"http://druid.io","size":89165,"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":"e161021902339f87adb4bd7027986cfaa991bb86","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":"Real²time Exploratory Analytics on Large Datasets","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}","created_at":"2012-10-23T19:08:07Z","updated_at":"2015-03-11T20:00:59Z","pushed_at":"2015-03-11T03:25:28Z","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":157647,"stargazers_count":1447,"watchers_count":1447,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":313,"mirror_url":null,"open_issues_count":123,"forks":313,"open_issues":123,"watchers":1447,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1177"},"html":{"href":"https://github.com/druid-io/druid/pull/1177"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/1177"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/1177/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1177/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/1177/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/916e35e04c5e5cd1aac7cd9e9355b2f3d8c6357a"}}}}