Subject: AnalysisException - Infer schema for the Parquet path


Have you tried catching error when you are creating a dataframe?

import scala.util.{Try, Success, Failure}
val df = Try(spark.read.
     format("com.databricks.spark.xml").
           option("rootTag", "hierarchy").
           option("rowTag", "sms_request").
           load("/tmp/broadcast.xml")) match {
               case Success(df) => df
               case Failure(exception) => throw new Exception("foo")
          }
HTH

Dr Mich Talebzadeh

LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*

http://talebzadehmich.wordpress.com
*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.
On Sat, 9 May 2020 at 22:51, Chetan Khatri <[EMAIL PROTECTED]>
wrote: