By default, 1000 batches are retained by Spark Streaming UI and status API. To change this, you can run the below command:
val sc = new SparkContext(new SparkConf())
./bin/spark-submit <all your existing options> --spark.streaming.ui.retainedBatches=2000