You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Unsupported schema element type: null
java.lang.IllegalArgumentException: Unsupported schema element type: null
at com.databricks.spark.xml.util.XSDToSchema$.getStructField(XSDToSchema.scala:216)
at com.databricks.spark.xml.util.XSDToSchema$.$anonfun$getStructField$4(XSDToSchema.scala:182)
at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
at com.databricks.spark.xml.util.XSDToSchema$.getStructField(XSDToSchema.scala:173)
at com.databricks.spark.xml.util.XSDToSchema$.$anonfun$getStructType$1(XSDToSchema.scala:227)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
at scala.collection.TraversableLike.map(TraversableLike.scala:286)
at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
at scala.collection.AbstractTraversable.map(Traversable.scala:108)
at com.databricks.spark.xml.util.XSDToSchema$.getStructType(XSDToSchema.scala:221)
at com.databricks.spark.xml.util.XSDToSchema$.read(XSDToSchema.scala:49)
at com.databricks.spark.xml.util.XSDToSchema$.read(XSDToSchema.scala:61)
It's caused by the elements inside the complexType not having the schemaType and hence null is passed into the getStructField function in Line 182 XSDToSchema.scala
val baseType = getStructField(xmlSchema, e.getSchemaType).dataType
I tried to parse the Example 3 from https://www.w3schools.com/xml/el_element.asp
and got the following exception
It's caused by the elements inside the complexType not having the
schemaTypeand hencenullis passed into thegetStructFieldfunction in Line 182 XSDToSchema.scala