val schemaParsed = XSDToSchema.read(Paths.get("/FileStore/tables/file.xsd"))
It is giving me an error FileNotFoundException: /FileStore/tables/file.xsd (No such file or directory)
But I have stored this .xsd file in this dir.already
any suggestion ?
Please check the existence of the file
Read the file as shown in the spark-xml github page.
import com.databricks.spark.xml.util.XSDToSchema
import java.nio.file.Paths
val schemaParsed = XSDToSchema.read(Paths.get("/dbfs/FileStore/tables/xsd/purchase_order_sample.xsd"))
print(schemaParsed)
Please note that when used within the code, the dbfs path is mentioned as /dbfs/
instead of dbfs:/
Please go through the link to understand further...