spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kappaganthu, Sivaram (ES)" <Sivaram.Kappagan...@ADP.com>
Subject RE: How to read a Multi Line json object via Spark
Date Tue, 15 Nov 2016 07:26:32 GMT
Hello,

Please find attached the old mail on this subject

Thanks,
Sivaram
From: Sree Eedupuganti [mailto:sree@inndata.in]
Sent: Tuesday, November 15, 2016 12:51 PM
To: user
Subject: How to read a Multi Line json object via Spark

I tried from Spark-Shell and i am getting the following error:

Here is the test.json file:


{

    "colorsArray": [{

        "red": "#f00",

        "green": "#0f0",

        "blue": "#00f",

        "cyan": "#0ff",

        "magenta": "#f0f",

        "yellow": "#ff0",

        "black": "#000"

    }]

}


scala> val jtex = sqlContext.read.format("json").option("samplingRatio","1.0").load("/user/spark/test.json")



       jtex: org.apache.spark.sql.DataFrame = [_corrupt_record: string]

Any suggestions please. Thanks.
--
Best Regards,
Sreeharsha Eedupuganti
Data Engineer
innData Analytics Private Limited

----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain
information that is privileged and confidential. If the reader of the message is not the intended
recipient or an authorized representative of the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited. If you have received
this communication in error, notify the sender immediately by return email and delete the
message and any attachments from your system.
Mime
View raw message