Created
May 11, 2020 15:38
-
-
Save chetkhatri/e9db45a9a047590570d224c1ae60736b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment