To stop or pause a running OPTIMIZE operation on a Delta table (started via executeCompaction()), there is no direct API in Delta Lake 2.x or earlier. If the OPTIMIZE is running as a Spark job, you can kill the associated Spark job.