steven created SPARK-7273:
-----------------------------

             Summary: The SQLContext.jsonFile() api has a problem when load a 
format json file?
                 Key: SPARK-7273
                 URL: https://issues.apache.org/jira/browse/SPARK-7273
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.3.1
            Reporter: steven
            Priority: Minor


my code as follow:
 val df = sqlContext.jsonFile("test.json");

test.json content is:
 { "name": "steven",
    "age" : "20"
}

the jsonFile invoke will get a Exception as follow:
      java.lang.RuntimeException: Failed to parse record     "age" : "20"}. 
Please make sure that each line of the file (or each string in the RDD) is a 
valid JSON object or an array of JSON objects.
        at scala.sys.package$.error(package.scala:27)
        at 
org.apache.spark.sql.json.JsonRDD$$anonfun$parseJson$1$$anonfun$apply$2.apply(JsonRDD.scala:313)
        at 
org.apache.spark.sql.json.JsonRDD$$anonfun$parseJson$1$$anonfun$apply$2.apply(JsonRDD.scala:307)

is it a bug?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to