[SPARK-3250] Implement Gap Sampling optimization for random sampling