I have the following json input sample.json
[{"level": 1, "firstFile": "one", "secondFile": "first"},
{"level": 1, "firstFile": "two", "secondFile": "sec"},
{"level": 2, "firstFile": "three", "secondFile": "third"}]
i want my result should be:
val first= List(List("one","two"),List("three"))
val second= List(List("first","sec"),List("third"))
build.sbt:
name := "Test"
version := "1.0"
scalaVersion := "2.11.0"
libraryDependencies ++= Seq("org.apache.spark" % "spark-sql_2.11" % "2.0.0" % "provided")
libraryDependencies += "com.typesafe" % "config" % "1.2.0"
libraryDependencies ++= Seq("org.slf4j" % "slf4j-api" % "1.7.5",
"org.clapper" %% "grizzled-slf4j" % "1.3.1")
libraryDependencies += "ch.qos.logback" % "logback-core" % "1.2.3"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3" % "test"
libraryDependencies += "com.databricks" % "spark-avro_2.11" % "4.0.0"
libraryDependencies += "io.circe" %% "circe-config" % "0.4.1"
retrieveManaged := true