{"action":"created","comment":{"url":"https://api.github.com/repos/caskdata/cdap/pulls/comments/197523242","pull_request_review_id":131290149,"id":197523242,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzUyMzI0Mg==","diff_hunk":"@@ -0,0 +1,357 @@\n+/*\n+ * Copyright © 2018 Cask Data, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+ * use this file except in compliance with the License. You may obtain a copy of\n+ * 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations under\n+ * the License.\n+ */\n+\n+package co.cask.cdap.data2.metadata.lineage.field;\n+\n+import co.cask.cdap.api.common.Bytes;\n+import co.cask.cdap.api.data.DatasetContext;\n+import co.cask.cdap.api.dataset.DatasetProperties;\n+import co.cask.cdap.api.dataset.lib.AbstractDataset;\n+import co.cask.cdap.api.dataset.table.Put;\n+import co.cask.cdap.api.dataset.table.Row;\n+import co.cask.cdap.api.dataset.table.Scanner;\n+import co.cask.cdap.api.dataset.table.Table;\n+import co.cask.cdap.api.lineage.field.EndPoint;\n+import co.cask.cdap.api.lineage.field.Operation;\n+import co.cask.cdap.common.app.RunIds;\n+import co.cask.cdap.data2.datafabric.dataset.DatasetsUtil;\n+import co.cask.cdap.data2.dataset2.DatasetFramework;\n+import co.cask.cdap.data2.dataset2.lib.table.MDSKey;\n+import co.cask.cdap.proto.codec.OperationTypeAdapter;\n+import co.cask.cdap.proto.id.DatasetId;\n+import co.cask.cdap.proto.id.NamespaceId;\n+import co.cask.cdap.proto.id.ProgramRunId;\n+import com.google.common.annotations.VisibleForTesting;\n+import com.google.common.base.Throwables;\n+import com.google.common.reflect.TypeToken;\n+import com.google.gson.Gson;\n+import com.google.gson.GsonBuilder;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.lang.reflect.Type;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.Map;\n+import java.util.Set;\n+import java.util.concurrent.TimeUnit;\n+\n+/**\n+ * Dataset to store/retrieve field level lineage information.\n+ */\n+public class FieldLineageDataset extends AbstractDataset {\n+\n+  // Storage format\n+  // --------------\n+  //\n+  // 1. For each unique set of operations one row is stored. Uniqueness of set of operations\n+  // is determined by the checksum of the operations.\n+  //\n+  // Row Key: c | <checksum-value>\n+  //\n+  // Column information:\n+  // a) Name: f | <EndPoint>\n+  // For each destination EndPoint in the set of operations, this column\n+  // stores the fields generated by those operations belonging to the given EndPoint.\n+  //\n+  // b) Name: i | <EndPoint | <field>\n+  // For each field generated for each of the destination EndPoint, this column stores\n+  // the collection of source EndPoint and field responsible for generating the given field.\n+  //\n+  // c) Name: o | <EndPoint> | <field>\n+  // For each field belonging to each of the source EndPoint, this column stores the\n+  // collection of destination EndPoint and fields that were generated by the given field.","path":"cdap-data-fabric/src/main/java/co/cask/cdap/data2/metadata/lineage/field/FieldLineageDataset.java","position":null,"original_position":76,"commit_id":"81a890876c9b5e020727a8753c6a2dbf6e8f49c8","original_commit_id":"a33efb465a5a7de587f558cf5c8ec303a5edac2c","user":{"login":"anew","id":483004,"node_id":"MDQ6VXNlcjQ4MzAwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/483004?v=4","gravatar_id":"","url":"https://api.github.com/users/anew","html_url":"https://github.com/anew","followers_url":"https://api.github.com/users/anew/followers","following_url":"https://api.github.com/users/anew/following{/other_user}","gists_url":"https://api.github.com/users/anew/gists{/gist_id}","starred_url":"https://api.github.com/users/anew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anew/subscriptions","organizations_url":"https://api.github.com/users/anew/orgs","repos_url":"https://api.github.com/users/anew/repos","events_url":"https://api.github.com/users/anew/events{/privacy}","received_events_url":"https://api.github.com/users/anew/received_events","type":"User","site_admin":false},"body":"or better, computed from?","created_at":"2018-06-22T17:56:32Z","updated_at":"2018-06-22T17:56:32Z","html_url":"https://github.com/caskdata/cdap/pull/10213#discussion_r197523242","pull_request_url":"https://api.github.com/repos/caskdata/cdap/pulls/10213","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/comments/197523242"},"html":{"href":"https://github.com/caskdata/cdap/pull/10213#discussion_r197523242"},"pull_request":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10213"}},"in_reply_to_id":196618657},"pull_request":{"url":"https://api.github.com/repos/caskdata/cdap/pulls/10213","id":195323948,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MzIzOTQ4","html_url":"https://github.com/caskdata/cdap/pull/10213","diff_url":"https://github.com/caskdata/cdap/pull/10213.diff","patch_url":"https://github.com/caskdata/cdap/pull/10213.patch","issue_url":"https://api.github.com/repos/caskdata/cdap/issues/10213","number":10213,"state":"open","locked":false,"title":"[CDAP-13267]Add implementation of the FieldLineageDataset and subscriber of FieldLineage info from TMS which writes to it.","user":{"login":"sagarkapare","id":5713570,"node_id":"MDQ6VXNlcjU3MTM1NzA=","avatar_url":"https://avatars3.githubusercontent.com/u/5713570?v=4","gravatar_id":"","url":"https://api.github.com/users/sagarkapare","html_url":"https://github.com/sagarkapare","followers_url":"https://api.github.com/users/sagarkapare/followers","following_url":"https://api.github.com/users/sagarkapare/following{/other_user}","gists_url":"https://api.github.com/users/sagarkapare/gists{/gist_id}","starred_url":"https://api.github.com/users/sagarkapare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagarkapare/subscriptions","organizations_url":"https://api.github.com/users/sagarkapare/orgs","repos_url":"https://api.github.com/users/sagarkapare/repos","events_url":"https://api.github.com/users/sagarkapare/events{/privacy}","received_events_url":"https://api.github.com/users/sagarkapare/received_events","type":"User","site_admin":false},"body":"JIRA: https://issues.cask.co/browse/CDAP-13267\r\n\r\nFollowing changes are implemented:\r\n1. `FieldLineageDataset` implementation to store the collection of operations and retrieve it given the specific time range. \r\n2. Ability to publish the FieldLineageInfo to the TMS and subscriber which retrieves it and writes to the field lineage dataset.","created_at":"2018-06-16T08:49:27Z","updated_at":"2018-06-22T17:56:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e60b65298b443c1d98495374bfeff3fb4eb6a00","assignee":{"login":"anew","id":483004,"node_id":"MDQ6VXNlcjQ4MzAwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/483004?v=4","gravatar_id":"","url":"https://api.github.com/users/anew","html_url":"https://github.com/anew","followers_url":"https://api.github.com/users/anew/followers","following_url":"https://api.github.com/users/anew/following{/other_user}","gists_url":"https://api.github.com/users/anew/gists{/gist_id}","starred_url":"https://api.github.com/users/anew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anew/subscriptions","organizations_url":"https://api.github.com/users/anew/orgs","repos_url":"https://api.github.com/users/anew/repos","events_url":"https://api.github.com/users/anew/events{/privacy}","received_events_url":"https://api.github.com/users/anew/received_events","type":"User","site_admin":false},"assignees":[{"login":"anew","id":483004,"node_id":"MDQ6VXNlcjQ4MzAwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/483004?v=4","gravatar_id":"","url":"https://api.github.com/users/anew","html_url":"https://github.com/anew","followers_url":"https://api.github.com/users/anew/followers","following_url":"https://api.github.com/users/anew/following{/other_user}","gists_url":"https://api.github.com/users/anew/gists{/gist_id}","starred_url":"https://api.github.com/users/anew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anew/subscriptions","organizations_url":"https://api.github.com/users/anew/orgs","repos_url":"https://api.github.com/users/anew/repos","events_url":"https://api.github.com/users/anew/events{/privacy}","received_events_url":"https://api.github.com/users/anew/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/caskdata/cdap/pulls/10213/commits","review_comments_url":"https://api.github.com/repos/caskdata/cdap/pulls/10213/comments","review_comment_url":"https://api.github.com/repos/caskdata/cdap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/caskdata/cdap/issues/10213/comments","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/81a890876c9b5e020727a8753c6a2dbf6e8f49c8","head":{"label":"caskdata:feature/CDAP-field-lineage-dataset","ref":"feature/CDAP-field-lineage-dataset","sha":"81a890876c9b5e020727a8753c6a2dbf6e8f49c8","user":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":22542759,"node_id":"MDEwOlJlcG9zaXRvcnkyMjU0Mjc1OQ==","name":"cdap","full_name":"caskdata/cdap","owner":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/cdap","description":"A Unified Integration Platform - Cask Data Application Platform (CDAP)","fork":false,"url":"https://api.github.com/repos/caskdata/cdap","forks_url":"https://api.github.com/repos/caskdata/cdap/forks","keys_url":"https://api.github.com/repos/caskdata/cdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/cdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/cdap/teams","hooks_url":"https://api.github.com/repos/caskdata/cdap/hooks","issue_events_url":"https://api.github.com/repos/caskdata/cdap/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/cdap/events","assignees_url":"https://api.github.com/repos/caskdata/cdap/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/cdap/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/cdap/tags","blobs_url":"https://api.github.com/repos/caskdata/cdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/cdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/cdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/cdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/cdap/languages","stargazers_url":"https://api.github.com/repos/caskdata/cdap/stargazers","contributors_url":"https://api.github.com/repos/caskdata/cdap/contributors","subscribers_url":"https://api.github.com/repos/caskdata/cdap/subscribers","subscription_url":"https://api.github.com/repos/caskdata/cdap/subscription","commits_url":"https://api.github.com/repos/caskdata/cdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/cdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/cdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/cdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/cdap/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/cdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/cdap/merges","archive_url":"https://api.github.com/repos/caskdata/cdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/cdap/downloads","issues_url":"https://api.github.com/repos/caskdata/cdap/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/cdap/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/cdap/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/cdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/cdap/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/cdap/releases{/id}","deployments_url":"https://api.github.com/repos/caskdata/cdap/deployments","created_at":"2014-08-02T09:00:10Z","updated_at":"2018-06-20T14:42:33Z","pushed_at":"2018-06-22T17:54:48Z","git_url":"git://github.com/caskdata/cdap.git","ssh_url":"git@github.com:caskdata/cdap.git","clone_url":"https://github.com/caskdata/cdap.git","svn_url":"https://github.com/caskdata/cdap","homepage":"http://docs.cask.co/cdap","size":533483,"stargazers_count":236,"watchers_count":236,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":119,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":119,"open_issues":25,"watchers":236,"default_branch":"develop"}},"base":{"label":"caskdata:develop","ref":"develop","sha":"4494b2ac00f01e681898352d20eec26f0ff61b45","user":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":22542759,"node_id":"MDEwOlJlcG9zaXRvcnkyMjU0Mjc1OQ==","name":"cdap","full_name":"caskdata/cdap","owner":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/cdap","description":"A Unified Integration Platform - Cask Data Application Platform (CDAP)","fork":false,"url":"https://api.github.com/repos/caskdata/cdap","forks_url":"https://api.github.com/repos/caskdata/cdap/forks","keys_url":"https://api.github.com/repos/caskdata/cdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/cdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/cdap/teams","hooks_url":"https://api.github.com/repos/caskdata/cdap/hooks","issue_events_url":"https://api.github.com/repos/caskdata/cdap/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/cdap/events","assignees_url":"https://api.github.com/repos/caskdata/cdap/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/cdap/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/cdap/tags","blobs_url":"https://api.github.com/repos/caskdata/cdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/cdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/cdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/cdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/cdap/languages","stargazers_url":"https://api.github.com/repos/caskdata/cdap/stargazers","contributors_url":"https://api.github.com/repos/caskdata/cdap/contributors","subscribers_url":"https://api.github.com/repos/caskdata/cdap/subscribers","subscription_url":"https://api.github.com/repos/caskdata/cdap/subscription","commits_url":"https://api.github.com/repos/caskdata/cdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/cdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/cdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/cdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/cdap/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/cdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/cdap/merges","archive_url":"https://api.github.com/repos/caskdata/cdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/cdap/downloads","issues_url":"https://api.github.com/repos/caskdata/cdap/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/cdap/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/cdap/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/cdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/cdap/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/cdap/releases{/id}","deployments_url":"https://api.github.com/repos/caskdata/cdap/deployments","created_at":"2014-08-02T09:00:10Z","updated_at":"2018-06-20T14:42:33Z","pushed_at":"2018-06-22T17:54:48Z","git_url":"git://github.com/caskdata/cdap.git","ssh_url":"git@github.com:caskdata/cdap.git","clone_url":"https://github.com/caskdata/cdap.git","svn_url":"https://github.com/caskdata/cdap","homepage":"http://docs.cask.co/cdap","size":533483,"stargazers_count":236,"watchers_count":236,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":119,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":119,"open_issues":25,"watchers":236,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10213"},"html":{"href":"https://github.com/caskdata/cdap/pull/10213"},"issue":{"href":"https://api.github.com/repos/caskdata/cdap/issues/10213"},"comments":{"href":"https://api.github.com/repos/caskdata/cdap/issues/10213/comments"},"review_comments":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10213/comments"},"review_comment":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10213/commits"},"statuses":{"href":"https://api.github.com/repos/caskdata/cdap/statuses/81a890876c9b5e020727a8753c6a2dbf6e8f49c8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anew"}}