{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/comments/200796990","pull_request_review_id":135187416,"id":200796990,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDc5Njk5MA==","diff_hunk":"@@ -151,6 +153,39 @@ object CosmosDBRowConverter extends RowConverter[Document]\n     }\n   }\n \n+  def internalRowToJSONObject(internalRow: InternalRow, schema: StructType): JSONObject = {\n+    var jsonObject: JSONObject = new JSONObject()\n+    schema.fields.zipWithIndex.foreach({\n+      case (field, i) if internalRow.isNullAt(i) => if (field.dataType == NullType) jsonObject.remove(field.name)\n+      case (field, i)                    => jsonObject.put(field.name, convertInternalRowFieldToJson(internalRow.get(i, field.dataType), field.dataType))\n+    })\n+    jsonObject\n+  }\n+\n+  private def convertInternalRowFieldToJson(element: Any, elementType: DataType): Any = {","path":"src/main/scala/com/microsoft/azure/cosmosdb/spark/schema/CosmosDBRowConverter.scala","position":22,"original_position":22,"commit_id":"384decca69b15907b89a3a5b246e687364d6044c","original_commit_id":"db2d8125faba68b6ed58301cf40c87a5b028848f","user":{"login":"nomiero","id":98508,"node_id":"MDQ6VXNlcjk4NTA4","avatar_url":"https://avatars2.githubusercontent.com/u/98508?v=4","gravatar_id":"","url":"https://api.github.com/users/nomiero","html_url":"https://github.com/nomiero","followers_url":"https://api.github.com/users/nomiero/followers","following_url":"https://api.github.com/users/nomiero/following{/other_user}","gists_url":"https://api.github.com/users/nomiero/gists{/gist_id}","starred_url":"https://api.github.com/users/nomiero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomiero/subscriptions","organizations_url":"https://api.github.com/users/nomiero/orgs","repos_url":"https://api.github.com/users/nomiero/repos","events_url":"https://api.github.com/users/nomiero/events{/privacy}","received_events_url":"https://api.github.com/users/nomiero/received_events","type":"User","site_admin":false},"body":"would it be cleaner to make it case String => convert to UTF8\r\n                                                case any => convertToJson()  \r\n? ","created_at":"2018-07-07T00:41:06Z","updated_at":"2018-07-07T00:41:06Z","html_url":"https://github.com/Azure/azure-cosmosdb-spark/pull/211#discussion_r200796990","pull_request_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/comments/200796990"},"html":{"href":"https://github.com/Azure/azure-cosmosdb-spark/pull/211#discussion_r200796990"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211"}},"in_reply_to_id":200795893},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211","id":199868323,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5ODY4MzIz","html_url":"https://github.com/Azure/azure-cosmosdb-spark/pull/211","diff_url":"https://github.com/Azure/azure-cosmosdb-spark/pull/211.diff","patch_url":"https://github.com/Azure/azure-cosmosdb-spark/pull/211.patch","issue_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues/211","number":211,"state":"open","locked":false,"title":"Fix structured streaming sink - 'write' on streaming dataframe issue …","user":{"login":"tknandu","id":1701448,"node_id":"MDQ6VXNlcjE3MDE0NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/1701448?v=4","gravatar_id":"","url":"https://api.github.com/users/tknandu","html_url":"https://github.com/tknandu","followers_url":"https://api.github.com/users/tknandu/followers","following_url":"https://api.github.com/users/tknandu/following{/other_user}","gists_url":"https://api.github.com/users/tknandu/gists{/gist_id}","starred_url":"https://api.github.com/users/tknandu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tknandu/subscriptions","organizations_url":"https://api.github.com/users/tknandu/orgs","repos_url":"https://api.github.com/users/tknandu/repos","events_url":"https://api.github.com/users/tknandu/events{/privacy}","received_events_url":"https://api.github.com/users/tknandu/received_events","type":"User","site_admin":false},"body":"…+ Set correct default SDK connection policy defaults","created_at":"2018-07-06T23:51:19Z","updated_at":"2018-07-07T00:41:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b412d09b67c5c6e6640adff424f4e20e3b0a915a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"arramac","id":8397225,"node_id":"MDQ6VXNlcjgzOTcyMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/8397225?v=4","gravatar_id":"","url":"https://api.github.com/users/arramac","html_url":"https://github.com/arramac","followers_url":"https://api.github.com/users/arramac/followers","following_url":"https://api.github.com/users/arramac/following{/other_user}","gists_url":"https://api.github.com/users/arramac/gists{/gist_id}","starred_url":"https://api.github.com/users/arramac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arramac/subscriptions","organizations_url":"https://api.github.com/users/arramac/orgs","repos_url":"https://api.github.com/users/arramac/repos","events_url":"https://api.github.com/users/arramac/events{/privacy}","received_events_url":"https://api.github.com/users/arramac/received_events","type":"User","site_admin":false},{"login":"khdang","id":10590707,"node_id":"MDQ6VXNlcjEwNTkwNzA3","avatar_url":"https://avatars2.githubusercontent.com/u/10590707?v=4","gravatar_id":"","url":"https://api.github.com/users/khdang","html_url":"https://github.com/khdang","followers_url":"https://api.github.com/users/khdang/followers","following_url":"https://api.github.com/users/khdang/following{/other_user}","gists_url":"https://api.github.com/users/khdang/gists{/gist_id}","starred_url":"https://api.github.com/users/khdang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khdang/subscriptions","organizations_url":"https://api.github.com/users/khdang/orgs","repos_url":"https://api.github.com/users/khdang/repos","events_url":"https://api.github.com/users/khdang/events{/privacy}","received_events_url":"https://api.github.com/users/khdang/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues/211/comments","statuses_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/statuses/384decca69b15907b89a3a5b246e687364d6044c","head":{"label":"tknandu:2.3","ref":"2.3","sha":"384decca69b15907b89a3a5b246e687364d6044c","user":{"login":"tknandu","id":1701448,"node_id":"MDQ6VXNlcjE3MDE0NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/1701448?v=4","gravatar_id":"","url":"https://api.github.com/users/tknandu","html_url":"https://github.com/tknandu","followers_url":"https://api.github.com/users/tknandu/followers","following_url":"https://api.github.com/users/tknandu/following{/other_user}","gists_url":"https://api.github.com/users/tknandu/gists{/gist_id}","starred_url":"https://api.github.com/users/tknandu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tknandu/subscriptions","organizations_url":"https://api.github.com/users/tknandu/orgs","repos_url":"https://api.github.com/users/tknandu/repos","events_url":"https://api.github.com/users/tknandu/events{/privacy}","received_events_url":"https://api.github.com/users/tknandu/received_events","type":"User","site_admin":false},"repo":{"id":121698813,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE2OTg4MTM=","name":"azure-cosmosdb-spark","full_name":"tknandu/azure-cosmosdb-spark","owner":{"login":"tknandu","id":1701448,"node_id":"MDQ6VXNlcjE3MDE0NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/1701448?v=4","gravatar_id":"","url":"https://api.github.com/users/tknandu","html_url":"https://github.com/tknandu","followers_url":"https://api.github.com/users/tknandu/followers","following_url":"https://api.github.com/users/tknandu/following{/other_user}","gists_url":"https://api.github.com/users/tknandu/gists{/gist_id}","starred_url":"https://api.github.com/users/tknandu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tknandu/subscriptions","organizations_url":"https://api.github.com/users/tknandu/orgs","repos_url":"https://api.github.com/users/tknandu/repos","events_url":"https://api.github.com/users/tknandu/events{/privacy}","received_events_url":"https://api.github.com/users/tknandu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tknandu/azure-cosmosdb-spark","description":"This project provides a client library that allows Azure Cosmos DB to act as an input source or output sink for Spark jobs.","fork":true,"url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark","forks_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/forks","keys_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/teams","hooks_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/hooks","issue_events_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/issues/events{/number}","events_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/events","assignees_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/assignees{/user}","branches_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/branches{/branch}","tags_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/tags","blobs_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/statuses/{sha}","languages_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/languages","stargazers_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/stargazers","contributors_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/contributors","subscribers_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/subscribers","subscription_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/subscription","commits_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/contents/{+path}","compare_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/merges","archive_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/downloads","issues_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/issues{/number}","pulls_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/pulls{/number}","milestones_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/milestones{/number}","notifications_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/labels{/name}","releases_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/releases{/id}","deployments_url":"https://api.github.com/repos/tknandu/azure-cosmosdb-spark/deployments","created_at":"2018-02-16T00:11:04Z","updated_at":"2018-06-23T19:15:00Z","pushed_at":"2018-07-07T00:00:56Z","git_url":"git://github.com/tknandu/azure-cosmosdb-spark.git","ssh_url":"git@github.com:tknandu/azure-cosmosdb-spark.git","clone_url":"https://github.com/tknandu/azure-cosmosdb-spark.git","svn_url":"https://github.com/tknandu/azure-cosmosdb-spark","homepage":"","size":200161,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:2.3","ref":"2.3","sha":"51b6c45d9b76261a52003cccde1e585efded236c","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":75215094,"node_id":"MDEwOlJlcG9zaXRvcnk3NTIxNTA5NA==","name":"azure-cosmosdb-spark","full_name":"Azure/azure-cosmosdb-spark","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-cosmosdb-spark","description":"Apache Spark Connector for Azure Cosmos DB","fork":false,"url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark","forks_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/forks","keys_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/teams","hooks_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/events","assignees_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/tags","blobs_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/subscription","commits_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/merges","archive_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/downloads","issues_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/deployments","created_at":"2016-11-30T18:28:33Z","updated_at":"2018-07-05T21:46:33Z","pushed_at":"2018-07-07T00:00:58Z","git_url":"git://github.com/Azure/azure-cosmosdb-spark.git","ssh_url":"git@github.com:Azure/azure-cosmosdb-spark.git","clone_url":"https://github.com/Azure/azure-cosmosdb-spark.git","svn_url":"https://github.com/Azure/azure-cosmosdb-spark","homepage":"","size":200176,"stargazers_count":76,"watchers_count":76,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":63,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":49,"open_issues":63,"watchers":76,"default_branch":"2.3"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211"},"html":{"href":"https://github.com/Azure/azure-cosmosdb-spark/pull/211"},"issue":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues/211"},"comments":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-cosmosdb-spark/statuses/384decca69b15907b89a3a5b246e687364d6044c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nomiero"}}