Spark cannot parse arbitrary json into a dataframe, since json is a hierarchical structure and the dataframe is flat. If your json does not create a spark, most likely it does not meet the condition "Each line must contain a separate, standalone valid JSON" and, therefore, will need to be analyzed using your custom code, and then passed to the dataframe as a collection of objects of the class case or sql spark lines.
You can download as:
import scalaj.http._ val response = Http("proto:///path/to/json") .header("key", "val").method("get") .execute().asString.body
and then parse your json as shown in this answer . And then create the Seq objects of your case class (say seq) and create a dataframe as
seq.toDF
source share