spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-17969) I think it's user unfriendly to process standard json file with DataFrame
Date Fri, 04 Nov 2016 18:03:58 GMT

     [ https://issues.apache.org/jira/browse/SPARK-17969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sean Owen resolved SPARK-17969.
-------------------------------
    Resolution: Won't Fix

> I think it's user unfriendly to process standard json file with DataFrame 
> --------------------------------------------------------------------------
>
>                 Key: SPARK-17969
>                 URL: https://issues.apache.org/jira/browse/SPARK-17969
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 2.0.1
>            Reporter: Jianfei Wang
>            Priority: Minor
>
> 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) 
> ```



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message