{"action":"created","issue":{"url":"https://api.github.com/repos/databricks/spark-xml/issues/110","repository_url":"https://api.github.com/repos/databricks/spark-xml","labels_url":"https://api.github.com/repos/databricks/spark-xml/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/databricks/spark-xml/issues/110/comments","events_url":"https://api.github.com/repos/databricks/spark-xml/issues/110/events","html_url":"https://github.com/databricks/spark-xml/pull/110","id":148926025,"number":110,"title":"Always Ignore XML comments wherever it is","user":{"login":"HyukjinKwon","id":6477701,"avatar_url":"https://avatars.githubusercontent.com/u/6477701?v=3","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-17T07:10:57Z","updated_at":"2016-04-25T09:22:18Z","closed_at":"2016-04-25T09:22:01Z","pull_request":{"url":"https://api.github.com/repos/databricks/spark-xml/pulls/110","html_url":"https://github.com/databricks/spark-xml/pull/110","diff_url":"https://github.com/databricks/spark-xml/pull/110.diff","patch_url":"https://github.com/databricks/spark-xml/pull/110.patch"},"body":"#100 \r\n\r\nAfter looking into CSV and JSON datasources, it looks okay to always ignore XML comments for now.\r\n\r\nThis could be pretty simply done by using `EventFilter` in StAX parser.\r\n\r\nThis PR ignore comments within XML documents.\r\n\r\nFor example, `printSchema()` on the data below:\r\n\r\n```xml\r\n <ROWSET>\r\n     <ROW>\r\n       <a>2012<!--A comment within tags--></a>\r\n     </ROW>\r\n  ...\r\n```\r\n\r\nproduces\r\n\r\n- **Before**\r\n\r\n```scala\r\njava.lang.RuntimeException: Failed to parse data with unexpected event <!--A comment before a value-->\r\n\tat scala.sys.package$.error(package.scala:27)\r\n\tat com.databricks.spark.xml.util.InferSchema$.inferField(InferSchema.scala:151)\r\n\tat com.databricks.spark.xml.util.InferSchema$.com$databricks$spark$xml$util$InferSchema$$inferObject(InferSchema.scala:178)\r\n\tat com.databricks.spark.xml.util.InferSchema$$anonfun$3$$anonfun$apply$2.apply(InferSchema.scala:101)\r\n\tat com.databricks.spark.xml.util.InferSchema$$anonfun$3$$anonfun$apply$2.apply(InferSchema.scala:89)\r\n```\r\n\r\n- **After**\r\n\r\n```bash\r\nroot\r\n |-- a: long (nullable = true)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/databricks/spark-xml/issues/comments/214226980","html_url":"https://github.com/databricks/spark-xml/pull/110#issuecomment-214226980","issue_url":"https://api.github.com/repos/databricks/spark-xml/issues/110","id":214226980,"user":{"login":"HyukjinKwon","id":6477701,"avatar_url":"https://avatars.githubusercontent.com/u/6477701?v=3","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"created_at":"2016-04-25T09:22:17Z","updated_at":"2016-04-25T09:22:17Z","body":"Merged."}}