[SPARK-3382] format improvements