spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conconscious <>
Subject json in Cassandra to RDDs
Date Sat, 01 Jul 2017 10:54:00 GMT
Hi list,

I'm using Cassandra with only 2 fields (id, json).
I'm using Spark to query the json. Until now I can use a json file and
query that file, but Cassandra and RDDs of the json field not yet.

sc = spark.sparkContext
path = "/home/me/red50k.json"
redirectsDF =
result = spark.sql("select idv from red where idv = '9'")

val conf = new SparkConf(true)
    .set("", "")
    .set("spark.cassandra.auth.username", "cassandra")
    .set("spark.cassandra.auth.password", "cassandra")
val sc = new SparkContext("spark://", "test", conf)
val table = sc.cassandraTable("test", "ttable")

Some help please to join both things. Scala or Python code for me it's ok.
Thanks in advance.

To unsubscribe e-mail:

View raw message