那是可以接受的解决方案吗?
val sc: SparkContext = ...val sqlContext = new SQLContext(sc)val escapedJsons: RDD[String] = sc.parallelize(Seq("""{"id":1,"name":"some name","problem_field":"{"height":180,"weight":80}"}"""))val unescapedJsons: RDD[String] = escapedJsons.map(_.replace(""{", "{").replace(""}", "}").replace("\"", """))val dfJsons: Dataframe = sqlContext.read.json(unescapedJsons)dfJsons.printSchema()// Outputroot|-- id: long (nullable = true)|-- name: string (nullable = true)|-- problem_field: struct (nullable = true)| |-- height: long (nullable = true)| |-- weight: long (nullable = true)


