{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/66141119","id":66141119,"diff_hunk":"@@ -0,0 +1,168 @@\n+/*\n+ * Copyright (C) 2014-2016 LinkedIn Corp. All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n+ * this file except in compliance with the License. You may obtain a copy of the\n+ * License at  http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed\n+ * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ * CONDITIONS OF ANY KIND, either express or implied.\n+ */\n+package gobblin.data.management.conversion.hive.converter;\n+\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+import lombok.extern.slf4j.Slf4j;\n+\n+import org.apache.avro.Schema;\n+import org.apache.commons.lang3.StringUtils;\n+\n+import com.google.common.base.Optional;\n+import com.google.common.base.Preconditions;\n+import com.google.common.base.Splitter;\n+\n+import gobblin.configuration.WorkUnitState;\n+import gobblin.converter.Converter;\n+import gobblin.converter.DataConversionException;\n+import gobblin.converter.SchemaConversionException;\n+import gobblin.converter.SingleRecordIterable;\n+import gobblin.data.management.conversion.hive.HiveSource;\n+import gobblin.data.management.conversion.hive.entities.QueryBasedHiveConversionEntity;\n+import gobblin.util.AvroFlattener;\n+import gobblin.data.management.conversion.hive.util.HiveAvroORCQueryUtils;\n+\n+/**\n+ * Builds the Hive avro to Orc conversion query. The record type for this converter is {@link QueryBasedHiveConversionEntity}. A {@link QueryBasedHiveConversionEntity}\n+ * can be a hive table or a hive partition.\n+ */\n+@Slf4j\n+public class HiveAvroToOrcConverter\n+    extends Converter<Schema, Schema, QueryBasedHiveConversionEntity, QueryBasedHiveConversionEntity> {\n+\n+  // TODO: Remove when topology is enabled\n+  private static final String ORC_TABLE_ALTERNATE_LOCATION = \"orc.table.alternate.location\";\n+\n+  private static AvroFlattener avroFlattener = new AvroFlattener();\n+\n+  @Override\n+  public Schema convertSchema(Schema inputSchema, WorkUnitState workUnit) throws SchemaConversionException {\n+    return inputSchema;\n+  }\n+\n+  /**\n+   * Populate the avro to orc conversion query which will be available at\n+   * {@link QueryBasedHiveConversionEntity#getConversionQuery()}\n+   *\n+   */\n+  @Override\n+  public Iterable<QueryBasedHiveConversionEntity> convertRecord(Schema outputSchema,\n+      QueryBasedHiveConversionEntity conversionEntity, WorkUnitState workUnit) throws DataConversionException {\n+    Preconditions.checkNotNull(outputSchema);","path":"gobblin-data-management/src/main/java/gobblin/data/management/conversion/hive/converter/HiveAvroToOrcConverter.java","position":63,"original_position":63,"commit_id":"5ee5bed28cca76aa2d863c52a3c7aac2a42992cf","original_commit_id":"5ee5bed28cca76aa2d863c52a3c7aac2a42992cf","user":{"login":"pcadabam","id":1166372,"avatar_url":"https://avatars.githubusercontent.com/u/1166372?v=3","gravatar_id":"","url":"https://api.github.com/users/pcadabam","html_url":"https://github.com/pcadabam","followers_url":"https://api.github.com/users/pcadabam/followers","following_url":"https://api.github.com/users/pcadabam/following{/other_user}","gists_url":"https://api.github.com/users/pcadabam/gists{/gist_id}","starred_url":"https://api.github.com/users/pcadabam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcadabam/subscriptions","organizations_url":"https://api.github.com/users/pcadabam/orgs","repos_url":"https://api.github.com/users/pcadabam/repos","events_url":"https://api.github.com/users/pcadabam/events{/privacy}","received_events_url":"https://api.github.com/users/pcadabam/received_events","type":"User","site_admin":false},"body":"Add error messages to all the Precondition checks","created_at":"2016-06-07T19:57:55Z","updated_at":"2016-06-07T19:57:55Z","html_url":"https://github.com/linkedin/gobblin/pull/1031#discussion_r66141119","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1031","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/66141119"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1031#discussion_r66141119"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1031"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/1031","id":72870077,"html_url":"https://github.com/linkedin/gobblin/pull/1031","diff_url":"https://github.com/linkedin/gobblin/pull/1031.diff","patch_url":"https://github.com/linkedin/gobblin/pull/1031.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/1031","number":1031,"state":"open","locked":false,"title":"Adding Avro To ORC conversion logic and related framework modifications","user":{"login":"abti","id":69499,"avatar_url":"https://avatars.githubusercontent.com/u/69499?v=3","gravatar_id":"","url":"https://api.github.com/users/abti","html_url":"https://github.com/abti","followers_url":"https://api.github.com/users/abti/followers","following_url":"https://api.github.com/users/abti/following{/other_user}","gists_url":"https://api.github.com/users/abti/gists{/gist_id}","starred_url":"https://api.github.com/users/abti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abti/subscriptions","organizations_url":"https://api.github.com/users/abti/orgs","repos_url":"https://api.github.com/users/abti/repos","events_url":"https://api.github.com/users/abti/events{/privacy}","received_events_url":"https://api.github.com/users/abti/received_events","type":"User","site_admin":false},"body":"@pcadabam Can you please review. ","created_at":"2016-06-07T12:58:33Z","updated_at":"2016-06-07T19:57:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bf81869cb9c28188004feb99701a1c4996a54f0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1031/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1031/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/1031/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/5ee5bed28cca76aa2d863c52a3c7aac2a42992cf","head":{"label":"abti:master","ref":"master","sha":"5ee5bed28cca76aa2d863c52a3c7aac2a42992cf","user":{"login":"abti","id":69499,"avatar_url":"https://avatars.githubusercontent.com/u/69499?v=3","gravatar_id":"","url":"https://api.github.com/users/abti","html_url":"https://github.com/abti","followers_url":"https://api.github.com/users/abti/followers","following_url":"https://api.github.com/users/abti/following{/other_user}","gists_url":"https://api.github.com/users/abti/gists{/gist_id}","starred_url":"https://api.github.com/users/abti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abti/subscriptions","organizations_url":"https://api.github.com/users/abti/orgs","repos_url":"https://api.github.com/users/abti/repos","events_url":"https://api.github.com/users/abti/events{/privacy}","received_events_url":"https://api.github.com/users/abti/received_events","type":"User","site_admin":false},"repo":{"id":42212016,"name":"gobblin","full_name":"abti/gobblin","owner":{"login":"abti","id":69499,"avatar_url":"https://avatars.githubusercontent.com/u/69499?v=3","gravatar_id":"","url":"https://api.github.com/users/abti","html_url":"https://github.com/abti","followers_url":"https://api.github.com/users/abti/followers","following_url":"https://api.github.com/users/abti/following{/other_user}","gists_url":"https://api.github.com/users/abti/gists{/gist_id}","starred_url":"https://api.github.com/users/abti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abti/subscriptions","organizations_url":"https://api.github.com/users/abti/orgs","repos_url":"https://api.github.com/users/abti/repos","events_url":"https://api.github.com/users/abti/events{/privacy}","received_events_url":"https://api.github.com/users/abti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abti/gobblin","description":"Universal data ingestion framework for Hadoop.","fork":true,"url":"https://api.github.com/repos/abti/gobblin","forks_url":"https://api.github.com/repos/abti/gobblin/forks","keys_url":"https://api.github.com/repos/abti/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abti/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abti/gobblin/teams","hooks_url":"https://api.github.com/repos/abti/gobblin/hooks","issue_events_url":"https://api.github.com/repos/abti/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/abti/gobblin/events","assignees_url":"https://api.github.com/repos/abti/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/abti/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/abti/gobblin/tags","blobs_url":"https://api.github.com/repos/abti/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abti/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abti/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/abti/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abti/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/abti/gobblin/languages","stargazers_url":"https://api.github.com/repos/abti/gobblin/stargazers","contributors_url":"https://api.github.com/repos/abti/gobblin/contributors","subscribers_url":"https://api.github.com/repos/abti/gobblin/subscribers","subscription_url":"https://api.github.com/repos/abti/gobblin/subscription","commits_url":"https://api.github.com/repos/abti/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/abti/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/abti/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/abti/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/abti/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/abti/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abti/gobblin/merges","archive_url":"https://api.github.com/repos/abti/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abti/gobblin/downloads","issues_url":"https://api.github.com/repos/abti/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/abti/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/abti/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/abti/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abti/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/abti/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/abti/gobblin/deployments","created_at":"2015-09-10T00:25:20Z","updated_at":"2016-01-14T21:11:37Z","pushed_at":"2016-06-07T12:54:08Z","git_url":"git://github.com/abti/gobblin.git","ssh_url":"git@github.com:abti/gobblin.git","clone_url":"https://github.com/abti/gobblin.git","svn_url":"https://github.com/abti/gobblin","homepage":"","size":86887,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"ef8dba7b7a7e8f9bb3cb11ed796dd65d85a6018f","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":27392543,"name":"gobblin","full_name":"linkedin/gobblin","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/gobblin","description":"Universal data ingestion framework for Hadoop.","fork":false,"url":"https://api.github.com/repos/linkedin/gobblin","forks_url":"https://api.github.com/repos/linkedin/gobblin/forks","keys_url":"https://api.github.com/repos/linkedin/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/gobblin/teams","hooks_url":"https://api.github.com/repos/linkedin/gobblin/hooks","issue_events_url":"https://api.github.com/repos/linkedin/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/gobblin/events","assignees_url":"https://api.github.com/repos/linkedin/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/gobblin/tags","blobs_url":"https://api.github.com/repos/linkedin/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/gobblin/languages","stargazers_url":"https://api.github.com/repos/linkedin/gobblin/stargazers","contributors_url":"https://api.github.com/repos/linkedin/gobblin/contributors","subscribers_url":"https://api.github.com/repos/linkedin/gobblin/subscribers","subscription_url":"https://api.github.com/repos/linkedin/gobblin/subscription","commits_url":"https://api.github.com/repos/linkedin/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/gobblin/merges","archive_url":"https://api.github.com/repos/linkedin/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/gobblin/downloads","issues_url":"https://api.github.com/repos/linkedin/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/gobblin/deployments","created_at":"2014-12-01T18:10:50Z","updated_at":"2016-06-07T05:26:56Z","pushed_at":"2016-06-07T19:19:01Z","git_url":"git://github.com/linkedin/gobblin.git","ssh_url":"git@github.com:linkedin/gobblin.git","clone_url":"https://github.com/linkedin/gobblin.git","svn_url":"https://github.com/linkedin/gobblin","homepage":"https://github.com/linkedin/gobblin/wiki","size":169102,"stargazers_count":589,"watchers_count":589,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":233,"mirror_url":null,"open_issues_count":88,"forks":233,"open_issues":88,"watchers":589,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1031"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1031"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1031"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1031/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1031/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1031/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/5ee5bed28cca76aa2d863c52a3c7aac2a42992cf"}}}}
{"actor":{"display_login":"pcadabam"}}