def getVaccumSize(table: String): Long = {
val listFiles = spark.sql(s"VACUUM $table DRY RUN").select("path").collect().map(_(0)).toList
var sum = 0L
listFiles.foreach(x => sum += dbutils.fs.ls(x.toString)(0).size)
sum
}
getVaccumSize("<your-table-name>")
You could use this function to get the size of files cleaned up