cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

filter push down into redis when querying using spark connector

almogg
New Contributor

Hi

I'm loading df from redis using this code:

df = (spark.read.format("org.apache.spark.sql.redis")
        .option("table", f"state_store_ready_to_sell")
        .option("key.column", "msid").option("infer.schema", "true").load()

and then i'm running filter , for example:

ready_to_sell = df.filter("msid in ('12321','12432')")

I looked at spark plan and spark does not push the msid filter to redis.

Which means that all redis records are loaded and filtered on spark memory (according to the sql tab is spark ui)

msid is key.column in redis of course.

How do i make spark push down the filter the fetch only the relevant records?

Thanks!

Almog

0 REPLIES 0
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.