Skip to content

fix: disable Fabric fast optimize during compaction - #111

Merged
Miles Cole (mwc360) merged 3 commits into
mainfrom
feat/fabric-spark-disable-fast-optimize
Sep 24, 2026
Merged

Miles Cole (mwc360) merged 3 commits into
mainfrom
feat/fabric-spark-disable-fast-optimize

Conversation

@mwc360

Copy link
Copy Markdown
Contributor

Summary

Temporarily disable Fabric Spark fast optimize while LakeBench runs an explicit OPTIMIZE command, then restore the exact prior session configuration even when compaction fails.

Rationale

Fast Optimize optimistically reduces scope of compaction operations to reduce write amplification but use cases that prioritize absolute best query performance, it is recommended to be disabled and let OPTIMIZE do a full scoped compaction job of all small files.

Miles Cole (mwc360) and others added 3 commits September 24, 2026 12:01
## Summary
Temporarily disable Fabric Spark fast optimize while LakeBench runs an explicit OPTIMIZE command, then restore the exact prior session configuration even when compaction fails.

## Prompting Intent
The engineer asked LakeBench's Fabric Spark engine to prevent fast optimize from skipping compaction work during benchmark OPTIMIZE phases while preserving the caller's pre-existing Spark configuration afterward. The change should remain narrowly scoped to Fabric Spark and avoid persistent session changes.

## Linked Sources
- Microsoft Fabric table compaction and fast optimize documentation: https://learn.microsoft.com/en-us/fabric/data-engineering/table-compaction

## Rationale
The configuration is changed around each OPTIMIZE call rather than during engine initialization. Constructor-scoped mutation would remain active when optimization is not requested and restoring after the first table would re-enable fast optimize for later tables in multi-table benchmarks. A try/finally block preserves the original value on both successful and failed compaction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mwc360
Miles Cole (mwc360) merged commit 28d58e6 into main Sep 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant