Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoreSurroundingSpaces is not working after upgrading to version 0.16.0 #636

Closed
irajhedayati opened this issue Apr 13, 2023 · 1 comment · Fixed by #637
Closed

ignoreSurroundingSpaces is not working after upgrading to version 0.16.0 #636

irajhedayati opened this issue Apr 13, 2023 · 1 comment · Fixed by #637
Assignees
Labels
Milestone

Comments

@irajhedayati
Copy link

After upgrading to 0.16.0 from 0.14.0, my tests started failing.

Here is the output of the unit test

== Results ==
!== Correct Answer - 4 ==   == Spark Answer - 4 ==
 struct<id:string>          struct<id:string>
![A]                        [ B]
![B]                        [ D ]
![C]                        [A]
![D]                        [C ]

Here is how I read the file

    context.spark.read
      .format("com.databricks.spark.xml")
      .option("mode", "FAILFAST")
      .option("inferSchema", true)
      .option("rootTag", "feed")
      .option("rowTag", "entry")
      .option("treatEmptyValuesAsNulls", true)
      .option("ignoreNamespace", true)
      .option("ignoreSurroundingSpaces", true)
      .load("/path/to/file.xml")

and this is the input file

<?xml version="1.0" encoding="UTF-8"?>
<feed>
    <entry>
        <id>A</id>
    </entry>
    <entry>
        <id> B</id>
    </entry>
    <entry>
        <id>C </id>
    </entry>
    <entry>
        <id> D </id>
    </entry>
</feed>
@srowen
Copy link
Collaborator

srowen commented Apr 13, 2023

Yeah, hm, I see what happened. I'll open a PR for this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants