Set TTL in AeroSpike with Spark

Hi guys,

I’m new to Aerospike. We are using Aerospike with Spark (Java) for our system.

I want to set TTL for a dataframe everytime the data is written to Aerospike. However, I could not find a way to do that even from document or Internet.

My current write syntax:

    networkDs.write()
            .mode(SaveMode.Overwrite)
            .format("com.aerospike.spark.sql")
            .option("aerospike.set", Const.AEROSPIKE_SET)
            .option("aerospike.updateByKey", "id")
            .save();

Can somebody tell me how to do that?

Thanks a lot.

The answer is here

1 Like