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

I think it's user unfriendly to process standard json file with DataFrame

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.0.1
    • None
    • SQL
    • None

    Description

      Currently, with DataFrame API, we can't load standard json file directly, maybe we can provide an override method to process this, the logic is as below:
      ```
      val df = spark.sparkContext.wholeTextFiles("data/test.json")
      val json_rdd = df.map( x => x.toString.replaceAll("
      s+","")).map

      { x => val index = x.indexOf(',') x.substring(index + 1, x.length - 1) }


      val json_df = spark.read.json(json_rdd)
      ```

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              codlife Jianfei Wang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: