[SPARK-3543] remaining cleanup work.