Skip to content

Reading redis sets as Key Value Pair RDD #261

Open
@yougaindra

Description

@yougaindra

Hi,

I was trying to read multiple sets from redis, according to documentation this is done using val setRDD = sc.fromRedisSet("keyPattern*") but this flattens out all sets, and returns RDD[String]. Is there a way to keep all sets data separate i.e get RDD[(String,Array(String))], where first value of tuple is key and second is the array containing set elements.

for example :
If I have following two sets in redis:

   key1 -> Set(v1,v2,v3)
   key2 -> Set(v4,v5)

calling sc.fromRedisSet("key*") returns RDD[String] = [v1,v2,v3,v4,v5] , is there a way to get RDD[(String,Array[String])] = [ (key1, Array(v1,v2,v3)) , (key2, Array(v4,v5)) ]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions