{"action":"closed","number":2,"pull_request":{"url":"https://api.github.com/repos/databricks/learning-spark/pulls/2","id":31775896,"html_url":"https://github.com/databricks/learning-spark/pull/2","diff_url":"https://github.com/databricks/learning-spark/pull/2.diff","patch_url":"https://github.com/databricks/learning-spark/pull/2.patch","issue_url":"https://api.github.com/repos/databricks/learning-spark/issues/2","number":2,"state":"closed","locked":false,"title":"Solve serialization problem for Jackson ObjectMapper","user":{"login":"aalkilani","id":3506008,"avatar_url":"https://avatars.githubusercontent.com/u/3506008?v=3","gravatar_id":"","url":"https://api.github.com/users/aalkilani","html_url":"https://github.com/aalkilani","followers_url":"https://api.github.com/users/aalkilani/followers","following_url":"https://api.github.com/users/aalkilani/following{/other_user}","gists_url":"https://api.github.com/users/aalkilani/gists{/gist_id}","starred_url":"https://api.github.com/users/aalkilani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalkilani/subscriptions","organizations_url":"https://api.github.com/users/aalkilani/orgs","repos_url":"https://api.github.com/users/aalkilani/repos","events_url":"https://api.github.com/users/aalkilani/events{/privacy}","received_events_url":"https://api.github.com/users/aalkilani/received_events","type":"User","site_admin":false},"body":"Code as is doesn't work on a distributed system due to serialization of the ObjectMapper. There are 2 solutions for this. Abstract the ObjectMapper within a singleton Object class on the driver. This has performance implications that everything going through that has to be on the driver node. This may or may not be an issue depending on where you're at in processing. If this is the very first step, then perhaps the driver is the best place for this. While good in that case, it still keeps receiving and processing concerns coupled and a repartition of the stream won't help add processing capacity if this is the bottleneck.\r\n\r\nThe alternative approach, as demonstrated by the code, is to have each execute create the object using mapPartitions to alleviate heavy object creation, i.e., so we don't create the object for each record and instead, once per partition.","created_at":"2015-03-23T21:28:06Z","updated_at":"2015-04-22T05:02:09Z","closed_at":"2015-04-22T05:02:09Z","merged_at":"2015-04-22T05:02:09Z","merge_commit_sha":"71701790e80e5677701e0642529f98642d551276","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/databricks/learning-spark/pulls/2/commits","review_comments_url":"https://api.github.com/repos/databricks/learning-spark/pulls/2/comments","review_comment_url":"https://api.github.com/repos/databricks/learning-spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/databricks/learning-spark/issues/2/comments","statuses_url":"https://api.github.com/repos/databricks/learning-spark/statuses/fac359e0eb6cc6b2e00249670fbeacf26df1c22f","head":{"label":"aalkilani:patch-1","ref":"patch-1","sha":"fac359e0eb6cc6b2e00249670fbeacf26df1c22f","user":{"login":"aalkilani","id":3506008,"avatar_url":"https://avatars.githubusercontent.com/u/3506008?v=3","gravatar_id":"","url":"https://api.github.com/users/aalkilani","html_url":"https://github.com/aalkilani","followers_url":"https://api.github.com/users/aalkilani/followers","following_url":"https://api.github.com/users/aalkilani/following{/other_user}","gists_url":"https://api.github.com/users/aalkilani/gists{/gist_id}","starred_url":"https://api.github.com/users/aalkilani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalkilani/subscriptions","organizations_url":"https://api.github.com/users/aalkilani/orgs","repos_url":"https://api.github.com/users/aalkilani/repos","events_url":"https://api.github.com/users/aalkilani/events{/privacy}","received_events_url":"https://api.github.com/users/aalkilani/received_events","type":"User","site_admin":false},"repo":{"id":32759200,"name":"learning-spark","full_name":"aalkilani/learning-spark","owner":{"login":"aalkilani","id":3506008,"avatar_url":"https://avatars.githubusercontent.com/u/3506008?v=3","gravatar_id":"","url":"https://api.github.com/users/aalkilani","html_url":"https://github.com/aalkilani","followers_url":"https://api.github.com/users/aalkilani/followers","following_url":"https://api.github.com/users/aalkilani/following{/other_user}","gists_url":"https://api.github.com/users/aalkilani/gists{/gist_id}","starred_url":"https://api.github.com/users/aalkilani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalkilani/subscriptions","organizations_url":"https://api.github.com/users/aalkilani/orgs","repos_url":"https://api.github.com/users/aalkilani/repos","events_url":"https://api.github.com/users/aalkilani/events{/privacy}","received_events_url":"https://api.github.com/users/aalkilani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aalkilani/learning-spark","description":"Example code from Learning Spark book","fork":true,"url":"https://api.github.com/repos/aalkilani/learning-spark","forks_url":"https://api.github.com/repos/aalkilani/learning-spark/forks","keys_url":"https://api.github.com/repos/aalkilani/learning-spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aalkilani/learning-spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aalkilani/learning-spark/teams","hooks_url":"https://api.github.com/repos/aalkilani/learning-spark/hooks","issue_events_url":"https://api.github.com/repos/aalkilani/learning-spark/issues/events{/number}","events_url":"https://api.github.com/repos/aalkilani/learning-spark/events","assignees_url":"https://api.github.com/repos/aalkilani/learning-spark/assignees{/user}","branches_url":"https://api.github.com/repos/aalkilani/learning-spark/branches{/branch}","tags_url":"https://api.github.com/repos/aalkilani/learning-spark/tags","blobs_url":"https://api.github.com/repos/aalkilani/learning-spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aalkilani/learning-spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aalkilani/learning-spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/aalkilani/learning-spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aalkilani/learning-spark/statuses/{sha}","languages_url":"https://api.github.com/repos/aalkilani/learning-spark/languages","stargazers_url":"https://api.github.com/repos/aalkilani/learning-spark/stargazers","contributors_url":"https://api.github.com/repos/aalkilani/learning-spark/contributors","subscribers_url":"https://api.github.com/repos/aalkilani/learning-spark/subscribers","subscription_url":"https://api.github.com/repos/aalkilani/learning-spark/subscription","commits_url":"https://api.github.com/repos/aalkilani/learning-spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/aalkilani/learning-spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/aalkilani/learning-spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/aalkilani/learning-spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/aalkilani/learning-spark/contents/{+path}","compare_url":"https://api.github.com/repos/aalkilani/learning-spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aalkilani/learning-spark/merges","archive_url":"https://api.github.com/repos/aalkilani/learning-spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aalkilani/learning-spark/downloads","issues_url":"https://api.github.com/repos/aalkilani/learning-spark/issues{/number}","pulls_url":"https://api.github.com/repos/aalkilani/learning-spark/pulls{/number}","milestones_url":"https://api.github.com/repos/aalkilani/learning-spark/milestones{/number}","notifications_url":"https://api.github.com/repos/aalkilani/learning-spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aalkilani/learning-spark/labels{/name}","releases_url":"https://api.github.com/repos/aalkilani/learning-spark/releases{/id}","created_at":"2015-03-23T21:12:20Z","updated_at":"2015-03-23T21:12:20Z","pushed_at":"2015-03-23T21:27:28Z","git_url":"git://github.com/aalkilani/learning-spark.git","ssh_url":"git@github.com:aalkilani/learning-spark.git","clone_url":"https://github.com/aalkilani/learning-spark.git","svn_url":"https://github.com/aalkilani/learning-spark","homepage":"","size":431,"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":"databricks:master","ref":"master","sha":"d9e99507576a087ab2c5c3abb13fb54615103604","user":{"login":"databricks","id":4998052,"avatar_url":"https://avatars.githubusercontent.com/u/4998052?v=3","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"repo":{"id":20873044,"name":"learning-spark","full_name":"databricks/learning-spark","owner":{"login":"databricks","id":4998052,"avatar_url":"https://avatars.githubusercontent.com/u/4998052?v=3","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/databricks/learning-spark","description":"Example code from Learning Spark book","fork":false,"url":"https://api.github.com/repos/databricks/learning-spark","forks_url":"https://api.github.com/repos/databricks/learning-spark/forks","keys_url":"https://api.github.com/repos/databricks/learning-spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/databricks/learning-spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/databricks/learning-spark/teams","hooks_url":"https://api.github.com/repos/databricks/learning-spark/hooks","issue_events_url":"https://api.github.com/repos/databricks/learning-spark/issues/events{/number}","events_url":"https://api.github.com/repos/databricks/learning-spark/events","assignees_url":"https://api.github.com/repos/databricks/learning-spark/assignees{/user}","branches_url":"https://api.github.com/repos/databricks/learning-spark/branches{/branch}","tags_url":"https://api.github.com/repos/databricks/learning-spark/tags","blobs_url":"https://api.github.com/repos/databricks/learning-spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/databricks/learning-spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/databricks/learning-spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/databricks/learning-spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/databricks/learning-spark/statuses/{sha}","languages_url":"https://api.github.com/repos/databricks/learning-spark/languages","stargazers_url":"https://api.github.com/repos/databricks/learning-spark/stargazers","contributors_url":"https://api.github.com/repos/databricks/learning-spark/contributors","subscribers_url":"https://api.github.com/repos/databricks/learning-spark/subscribers","subscription_url":"https://api.github.com/repos/databricks/learning-spark/subscription","commits_url":"https://api.github.com/repos/databricks/learning-spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/databricks/learning-spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/databricks/learning-spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/databricks/learning-spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/databricks/learning-spark/contents/{+path}","compare_url":"https://api.github.com/repos/databricks/learning-spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/databricks/learning-spark/merges","archive_url":"https://api.github.com/repos/databricks/learning-spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/databricks/learning-spark/downloads","issues_url":"https://api.github.com/repos/databricks/learning-spark/issues{/number}","pulls_url":"https://api.github.com/repos/databricks/learning-spark/pulls{/number}","milestones_url":"https://api.github.com/repos/databricks/learning-spark/milestones{/number}","notifications_url":"https://api.github.com/repos/databricks/learning-spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/databricks/learning-spark/labels{/name}","releases_url":"https://api.github.com/repos/databricks/learning-spark/releases{/id}","created_at":"2014-06-16T04:47:54Z","updated_at":"2015-04-22T04:54:08Z","pushed_at":"2015-04-22T05:02:09Z","git_url":"git://github.com/databricks/learning-spark.git","ssh_url":"git@github.com:databricks/learning-spark.git","clone_url":"https://github.com/databricks/learning-spark.git","svn_url":"https://github.com/databricks/learning-spark","homepage":"","size":670,"stargazers_count":306,"watchers_count":306,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"open_issues_count":1,"forks":204,"open_issues":1,"watchers":306,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/databricks/learning-spark/pulls/2"},"html":{"href":"https://github.com/databricks/learning-spark/pull/2"},"issue":{"href":"https://api.github.com/repos/databricks/learning-spark/issues/2"},"comments":{"href":"https://api.github.com/repos/databricks/learning-spark/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/databricks/learning-spark/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/databricks/learning-spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/databricks/learning-spark/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/databricks/learning-spark/statuses/fac359e0eb6cc6b2e00249670fbeacf26df1c22f"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"holdenk","id":59893,"avatar_url":"https://avatars.githubusercontent.com/u/59893?v=3","gravatar_id":"","url":"https://api.github.com/users/holdenk","html_url":"https://github.com/holdenk","followers_url":"https://api.github.com/users/holdenk/followers","following_url":"https://api.github.com/users/holdenk/following{/other_user}","gists_url":"https://api.github.com/users/holdenk/gists{/gist_id}","starred_url":"https://api.github.com/users/holdenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holdenk/subscriptions","organizations_url":"https://api.github.com/users/holdenk/orgs","repos_url":"https://api.github.com/users/holdenk/repos","events_url":"https://api.github.com/users/holdenk/events{/privacy}","received_events_url":"https://api.github.com/users/holdenk/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":23,"deletions":12,"changed_files":1}}