{"action":"created","comment":{"url":"https://api.github.com/repos/databricks/spark-xml/pulls/comments/242715511","pull_request_review_id":186294729,"id":242715511,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjcxNTUxMQ==","diff_hunk":"@@ -253,7 +255,7 @@ private[xml] class XmlRecordReader extends RecordReader[LongWritable, Text] {\n   private def checkAttributes(current: Int): Boolean = {\n     var len = 0\n     var b = current\n-    while(len < space.length && b == space(len)) {\n+    while (len < space.length && b == space(len) || newLineSpace.exists(_.apply(len) == b)) {","path":"src/main/scala/com/databricks/spark/xml/XmlInputFormat.scala","position":21,"original_position":21,"commit_id":"a437863d9661535ccae128efe37cdeba91116c7c","original_commit_id":"a437863d9661535ccae128efe37cdeba91116c7c","user":{"login":"BioQwer","id":5636129,"node_id":"MDQ6VXNlcjU2MzYxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/5636129?v=4","gravatar_id":"","url":"https://api.github.com/users/BioQwer","html_url":"https://github.com/BioQwer","followers_url":"https://api.github.com/users/BioQwer/followers","following_url":"https://api.github.com/users/BioQwer/following{/other_user}","gists_url":"https://api.github.com/users/BioQwer/gists{/gist_id}","starred_url":"https://api.github.com/users/BioQwer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BioQwer/subscriptions","organizations_url":"https://api.github.com/users/BioQwer/orgs","repos_url":"https://api.github.com/users/BioQwer/repos","events_url":"https://api.github.com/users/BioQwer/events{/privacy}","received_events_url":"https://api.github.com/users/BioQwer/received_events","type":"User","site_admin":false},"body":"> Really, I think this should just read while it can find a match for any whitespace character's bytes. (That would resolve the problem that this also doesn't allow multiple spaces before an attribute.) That means you can skip the \\r\\n case as it's contained in the \\r and \\n cases.\r\n\r\nI check it on multiple space, and it's work correctly\r\n```xml\r\n<note\r\n\r\n        \r\n        xmlns=\"http://www.w3schools.com\"\r\n\r\n        \r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http://www.w3schools.com note.xsd\">\r\n    <to\r\n\r\n    >\r\n\r\n        Tove</to>\r\n    <from>Jani</from>\r\n    <heading>Reminder</heading>\r\n    <body>Don't forget me this weekend!</body>\r\n</note>\r\n```\r\n\r\n> And then that means we should probably peek at input here not consume it, which means a buffered input stream.\r\n\r\nI don't see problem on this, because this library used for reading `xml` from `hdfs`.\r\n\r\n>  Oh boy, I might take a crack at this myself as this might be a bigger issue!\r\n\r\nOf course, this library may contains many hidden bugs.","created_at":"2018-12-18T21:39:52Z","updated_at":"2018-12-18T21:39:52Z","html_url":"https://github.com/databricks/spark-xml/pull/342#discussion_r242715511","pull_request_url":"https://api.github.com/repos/databricks/spark-xml/pulls/342","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-xml/pulls/comments/242715511"},"html":{"href":"https://github.com/databricks/spark-xml/pull/342#discussion_r242715511"},"pull_request":{"href":"https://api.github.com/repos/databricks/spark-xml/pulls/342"}},"in_reply_to_id":242651172},"pull_request":{"url":"https://api.github.com/repos/databricks/spark-xml/pulls/342","id":236269478,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2MjY5NDc4","html_url":"https://github.com/databricks/spark-xml/pull/342","diff_url":"https://github.com/databricks/spark-xml/pull/342.diff","patch_url":"https://github.com/databricks/spark-xml/pull/342.patch","issue_url":"https://api.github.com/repos/databricks/spark-xml/issues/342","number":342,"state":"open","locked":false,"title":"Fix reading tag with newline ","user":{"login":"BioQwer","id":5636129,"node_id":"MDQ6VXNlcjU2MzYxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/5636129?v=4","gravatar_id":"","url":"https://api.github.com/users/BioQwer","html_url":"https://github.com/BioQwer","followers_url":"https://api.github.com/users/BioQwer/followers","following_url":"https://api.github.com/users/BioQwer/following{/other_user}","gists_url":"https://api.github.com/users/BioQwer/gists{/gist_id}","starred_url":"https://api.github.com/users/BioQwer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BioQwer/subscriptions","organizations_url":"https://api.github.com/users/BioQwer/orgs","repos_url":"https://api.github.com/users/BioQwer/repos","events_url":"https://api.github.com/users/BioQwer/events{/privacy}","received_events_url":"https://api.github.com/users/BioQwer/received_events","type":"User","site_admin":false},"body":"Works for the following xml:\r\n```xml\r\n<?xml version=\"1.0\"?>\r\n<note xmlns=\"http://www.w3schools.com\"\r\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\nxsi:schemaLocation=\"http://www.w3schools.com note.xsd\">\r\n  <to>Tove</to>\r\n  <from>Jani</from>\r\n  <heading>Reminder</heading>\r\n  <body>Don't forget me this weekend!</body>\r\n</note>\r\n```\r\n\r\nbut doesn't work for the following xml (newline right after tag)\r\n\r\n```xml\r\n<?xml version=\"1.0\"?>\r\n<note\r\nxmlns=\"http://www.w3schools.com\"\r\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\nxsi:schemaLocation=\"http://www.w3schools.com note.xsd\">\r\n  <to>Tove</to>\r\n  <from>Jani</from>\r\n  <heading>Reminder</heading>\r\n  <body>Don't forget me this weekend!</body>\r\n</note>\r\n```\r\nThis PR fix this situation\r\n\r\nfix #120 ","created_at":"2018-12-05T17:59:54Z","updated_at":"2018-12-18T21:39:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b87686ce0245ea7b9a0bcc784a94c945342dcc3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/databricks/spark-xml/pulls/342/commits","review_comments_url":"https://api.github.com/repos/databricks/spark-xml/pulls/342/comments","review_comment_url":"https://api.github.com/repos/databricks/spark-xml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/databricks/spark-xml/issues/342/comments","statuses_url":"https://api.github.com/repos/databricks/spark-xml/statuses/a437863d9661535ccae128efe37cdeba91116c7c","head":{"label":"BioQwer:issue/120","ref":"issue/120","sha":"a437863d9661535ccae128efe37cdeba91116c7c","user":{"login":"BioQwer","id":5636129,"node_id":"MDQ6VXNlcjU2MzYxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/5636129?v=4","gravatar_id":"","url":"https://api.github.com/users/BioQwer","html_url":"https://github.com/BioQwer","followers_url":"https://api.github.com/users/BioQwer/followers","following_url":"https://api.github.com/users/BioQwer/following{/other_user}","gists_url":"https://api.github.com/users/BioQwer/gists{/gist_id}","starred_url":"https://api.github.com/users/BioQwer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BioQwer/subscriptions","organizations_url":"https://api.github.com/users/BioQwer/orgs","repos_url":"https://api.github.com/users/BioQwer/repos","events_url":"https://api.github.com/users/BioQwer/events{/privacy}","received_events_url":"https://api.github.com/users/BioQwer/received_events","type":"User","site_admin":false},"repo":{"id":143185331,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMxODUzMzE=","name":"spark-xml","full_name":"BioQwer/spark-xml","private":false,"owner":{"login":"BioQwer","id":5636129,"node_id":"MDQ6VXNlcjU2MzYxMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/5636129?v=4","gravatar_id":"","url":"https://api.github.com/users/BioQwer","html_url":"https://github.com/BioQwer","followers_url":"https://api.github.com/users/BioQwer/followers","following_url":"https://api.github.com/users/BioQwer/following{/other_user}","gists_url":"https://api.github.com/users/BioQwer/gists{/gist_id}","starred_url":"https://api.github.com/users/BioQwer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BioQwer/subscriptions","organizations_url":"https://api.github.com/users/BioQwer/orgs","repos_url":"https://api.github.com/users/BioQwer/repos","events_url":"https://api.github.com/users/BioQwer/events{/privacy}","received_events_url":"https://api.github.com/users/BioQwer/received_events","type":"User","site_admin":false},"html_url":"https://github.com/BioQwer/spark-xml","description":"XML data source for Spark SQL and DataFrames","fork":true,"url":"https://api.github.com/repos/BioQwer/spark-xml","forks_url":"https://api.github.com/repos/BioQwer/spark-xml/forks","keys_url":"https://api.github.com/repos/BioQwer/spark-xml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BioQwer/spark-xml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BioQwer/spark-xml/teams","hooks_url":"https://api.github.com/repos/BioQwer/spark-xml/hooks","issue_events_url":"https://api.github.com/repos/BioQwer/spark-xml/issues/events{/number}","events_url":"https://api.github.com/repos/BioQwer/spark-xml/events","assignees_url":"https://api.github.com/repos/BioQwer/spark-xml/assignees{/user}","branches_url":"https://api.github.com/repos/BioQwer/spark-xml/branches{/branch}","tags_url":"https://api.github.com/repos/BioQwer/spark-xml/tags","blobs_url":"https://api.github.com/repos/BioQwer/spark-xml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BioQwer/spark-xml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BioQwer/spark-xml/git/refs{/sha}","trees_url":"https://api.github.com/repos/BioQwer/spark-xml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BioQwer/spark-xml/statuses/{sha}","languages_url":"https://api.github.com/repos/BioQwer/spark-xml/languages","stargazers_url":"https://api.github.com/repos/BioQwer/spark-xml/stargazers","contributors_url":"https://api.github.com/repos/BioQwer/spark-xml/contributors","subscribers_url":"https://api.github.com/repos/BioQwer/spark-xml/subscribers","subscription_url":"https://api.github.com/repos/BioQwer/spark-xml/subscription","commits_url":"https://api.github.com/repos/BioQwer/spark-xml/commits{/sha}","git_commits_url":"https://api.github.com/repos/BioQwer/spark-xml/git/commits{/sha}","comments_url":"https://api.github.com/repos/BioQwer/spark-xml/comments{/number}","issue_comment_url":"https://api.github.com/repos/BioQwer/spark-xml/issues/comments{/number}","contents_url":"https://api.github.com/repos/BioQwer/spark-xml/contents/{+path}","compare_url":"https://api.github.com/repos/BioQwer/spark-xml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BioQwer/spark-xml/merges","archive_url":"https://api.github.com/repos/BioQwer/spark-xml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BioQwer/spark-xml/downloads","issues_url":"https://api.github.com/repos/BioQwer/spark-xml/issues{/number}","pulls_url":"https://api.github.com/repos/BioQwer/spark-xml/pulls{/number}","milestones_url":"https://api.github.com/repos/BioQwer/spark-xml/milestones{/number}","notifications_url":"https://api.github.com/repos/BioQwer/spark-xml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BioQwer/spark-xml/labels{/name}","releases_url":"https://api.github.com/repos/BioQwer/spark-xml/releases{/id}","deployments_url":"https://api.github.com/repos/BioQwer/spark-xml/deployments","created_at":"2018-08-01T17:06:44Z","updated_at":"2018-11-25T09:11:08Z","pushed_at":"2018-12-06T12:23:31Z","git_url":"git://github.com/BioQwer/spark-xml.git","ssh_url":"git@github.com:BioQwer/spark-xml.git","clone_url":"https://github.com/BioQwer/spark-xml.git","svn_url":"https://github.com/BioQwer/spark-xml","homepage":null,"size":467,"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":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"databricks:master","ref":"master","sha":"f3772b296d77a5a92ae4e714f3f8cb9940f1f0f9","user":{"login":"databricks","id":4998052,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5OTgwNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/4998052?v=4","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":46900076,"node_id":"MDEwOlJlcG9zaXRvcnk0NjkwMDA3Ng==","name":"spark-xml","full_name":"databricks/spark-xml","private":false,"owner":{"login":"databricks","id":4998052,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5OTgwNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/4998052?v=4","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},"html_url":"https://github.com/databricks/spark-xml","description":"XML data source for Spark SQL and DataFrames","fork":false,"url":"https://api.github.com/repos/databricks/spark-xml","forks_url":"https://api.github.com/repos/databricks/spark-xml/forks","keys_url":"https://api.github.com/repos/databricks/spark-xml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/databricks/spark-xml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/databricks/spark-xml/teams","hooks_url":"https://api.github.com/repos/databricks/spark-xml/hooks","issue_events_url":"https://api.github.com/repos/databricks/spark-xml/issues/events{/number}","events_url":"https://api.github.com/repos/databricks/spark-xml/events","assignees_url":"https://api.github.com/repos/databricks/spark-xml/assignees{/user}","branches_url":"https://api.github.com/repos/databricks/spark-xml/branches{/branch}","tags_url":"https://api.github.com/repos/databricks/spark-xml/tags","blobs_url":"https://api.github.com/repos/databricks/spark-xml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/databricks/spark-xml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/databricks/spark-xml/git/refs{/sha}","trees_url":"https://api.github.com/repos/databricks/spark-xml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/databricks/spark-xml/statuses/{sha}","languages_url":"https://api.github.com/repos/databricks/spark-xml/languages","stargazers_url":"https://api.github.com/repos/databricks/spark-xml/stargazers","contributors_url":"https://api.github.com/repos/databricks/spark-xml/contributors","subscribers_url":"https://api.github.com/repos/databricks/spark-xml/subscribers","subscription_url":"https://api.github.com/repos/databricks/spark-xml/subscription","commits_url":"https://api.github.com/repos/databricks/spark-xml/commits{/sha}","git_commits_url":"https://api.github.com/repos/databricks/spark-xml/git/commits{/sha}","comments_url":"https://api.github.com/repos/databricks/spark-xml/comments{/number}","issue_comment_url":"https://api.github.com/repos/databricks/spark-xml/issues/comments{/number}","contents_url":"https://api.github.com/repos/databricks/spark-xml/contents/{+path}","compare_url":"https://api.github.com/repos/databricks/spark-xml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/databricks/spark-xml/merges","archive_url":"https://api.github.com/repos/databricks/spark-xml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/databricks/spark-xml/downloads","issues_url":"https://api.github.com/repos/databricks/spark-xml/issues{/number}","pulls_url":"https://api.github.com/repos/databricks/spark-xml/pulls{/number}","milestones_url":"https://api.github.com/repos/databricks/spark-xml/milestones{/number}","notifications_url":"https://api.github.com/repos/databricks/spark-xml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/databricks/spark-xml/labels{/name}","releases_url":"https://api.github.com/repos/databricks/spark-xml/releases{/id}","deployments_url":"https://api.github.com/repos/databricks/spark-xml/deployments","created_at":"2015-11-26T02:46:09Z","updated_at":"2018-12-18T16:51:36Z","pushed_at":"2018-12-18T16:51:33Z","git_url":"git://github.com/databricks/spark-xml.git","ssh_url":"git@github.com:databricks/spark-xml.git","clone_url":"https://github.com/databricks/spark-xml.git","svn_url":"https://github.com/databricks/spark-xml","homepage":null,"size":476,"stargazers_count":211,"watchers_count":211,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":105,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":124,"open_issues":105,"watchers":211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-xml/pulls/342"},"html":{"href":"https://github.com/databricks/spark-xml/pull/342"},"issue":{"href":"https://api.github.com/repos/databricks/spark-xml/issues/342"},"comments":{"href":"https://api.github.com/repos/databricks/spark-xml/issues/342/comments"},"review_comments":{"href":"https://api.github.com/repos/databricks/spark-xml/pulls/342/comments"},"review_comment":{"href":"https://api.github.com/repos/databricks/spark-xml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/databricks/spark-xml/pulls/342/commits"},"statuses":{"href":"https://api.github.com/repos/databricks/spark-xml/statuses/a437863d9661535ccae128efe37cdeba91116c7c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"BioQwer"}}