You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by swetha <sw...@gmail.com> on 2015/07/28 03:07:08 UTC
Json parsing library for Spark Streaming?
Hi,
What is the proper Json parsing library to use in Spark Streaming? Currently
I am trying to use Gson library in a Java class and calling the Java method
from a Scala class as shown below: What are the advantages of using Json4S
as against using Gson library in a Java class and calling it from Scala?
val lines = KafkaUtils.createStream(ssc, zkQuorum, group, topicMap).
map{case (x, y) => ((x.toString,
Utils.toJsonObject(y.toString).get("request").getAsJsonObject().get("queryString").toString))}
Thanks,
Swetha
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Json-parsing-library-for-Spark-Streaming-tp24016.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: Json parsing library for Spark Streaming?
Posted by pradyumnad <pr...@gmail.com>.
I use Play json, may be its very famous.
If you would like to try below is the sbt dependency
"com.typesafe.play" % "play-json_2.10" % "2.2.1",
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Json-parsing-library-for-Spark-Streaming-tp24016p24204.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: Json parsing library for Spark Streaming?
Posted by Ted Yu <yu...@gmail.com>.
json4s is used by https://github.com/hammerlab/spark-json-relay
See the other thread on 'Spree'
FYI
On Mon, Jul 27, 2015 at 6:07 PM, swetha <sw...@gmail.com> wrote:
> Hi,
>
> What is the proper Json parsing library to use in Spark Streaming?
> Currently
> I am trying to use Gson library in a Java class and calling the Java method
> from a Scala class as shown below: What are the advantages of using Json4S
> as against using Gson library in a Java class and calling it from Scala?
>
>
> val lines = KafkaUtils.createStream(ssc, zkQuorum, group, topicMap).
> map{case (x, y) => ((x.toString,
>
> Utils.toJsonObject(y.toString).get("request").getAsJsonObject().get("queryString").toString))}
>
> Thanks,
> Swetha
>
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/Json-parsing-library-for-Spark-Streaming-tp24016.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
>