Closed voban closed 11 months ago
Just don't set the attribute prefix? I don't see why that is necessary. You can rename the col as you like. Does your change make all tests pass though?
In our project, we load BigData files with a complex structure (arrays and structures up to 10 levels of deep). It seems to me that it is technically more difficult to rename nested fields in a dataset with a complex structure than not to add prefix immediately when reading. Yes, my change make all tests pass though.
It may lead to some ambiguities, but I suppose it's fine to try to allow it. Open a PR with the change.
Hello! I am using Spark 3.2.1 (Scala 2.12) and Spark XML last version 0.16.0.
I am attempting read this xml file:
I am using this code to do so:
I see the following result:
The schema of the dataset is correct, but the content is obviously displayed incorrectly. The value "Jack" of the attribute "name" is lost.
If you do everything the same, only without the empty value "" of the option "attributePrefix", then both the schema and the content will be correct:
I need to read xml file with a required empty attribute prefix. After studying the source code of your project, I suggest to fix lines 160-162 of the StaxXmlParser.scala. Before:
After:
This fix helps me and at the same time doesn't break any of your unit tests.
Thanks and regards!