Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-4068

NPE in jsonRDD schema inference

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.1.0
    • 1.2.0
    • SQL
    • None

    Description

      val jsonData = """{"data":[[null], [[["Test"]]]]}""" :: """{"other": ""}""" :: Nil
      sqlContext.jsonRDD(sc.parallelize(jsonData))
      
      org.apache.spark.SparkException: Job aborted due to stage failure: Task 13 in stage 5.0 failed 4 times, most recent failure: Lost task 13.3 in stage 5.0 (TID 347, ip-10-0-234-152.us-west-2.compute.internal): java.lang.NullPointerException: 
              org.apache.spark.sql.json.JsonRDD$$anonfun$org$apache$spark$sql$json$JsonRDD$$allKeysWithValueTypes$1.org$apache$spark$sql$json$JsonRDD$$anonfun$$buildKeyPathForInnerStructs$1(JsonRDD.scala:252)
              org.apache.spark.sql.json.JsonRDD$$anonfun$org$apache$spark$sql$json$JsonRDD$$allKeysWithValueTypes$1$$anonfun$org$apache$spark$sql$json$JsonRDD$$anonfun$$buildKeyPathForInnerStructs$1$3.apply(JsonRDD.scala:253)
              org.apache.spark.sql.json.JsonRDD$$anonfun$org$apache$spark$sql$json$JsonRDD$$allKeysWithValueTypes$1$$anonfun$org$apache$spark$sql$json$JsonRDD$$anonfun$$buildKeyPathForInnerStructs$1$3.apply(JsonRDD.scala:253)
              scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
              scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
              scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
              scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
              scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
              scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
      ...
      

      Attachments

        Activity

          People

            yhuai Yin Huai
            marmbrus Michael Armbrust
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: