Skip to content

feat: make writer's global-dict retained-memory budget configurable#279

Merged
dfa1 merged 1 commit into
mainfrom
feat/configurable-global-dict-budget
Jul 18, 2026
Merged

feat: make writer's global-dict retained-memory budget configurable#279
dfa1 merged 1 commit into
mainfrom
feat/configurable-global-dict-budget

Conversation

@dfa1

@dfa1 dfa1 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • The OOM fix (fix: bound VortexWriter's global-dict retained memory to avoid OOM on huge files #278) hardcoded the aggregate global-dictionary retained-memory budget at 256 MB (GLOBAL_DICT_MAX_RETAINED_BYTES). Exposes it via WriteOptions.withGlobalDictMaxRetainedBytes(long), following the exact existing withZoneMaps/withGlobalDict/withZstd convention.
  • Motivated by a concrete measurement: on nyc-311 (18.5M rows, 38 string columns), every column got demoted under the 256MB default (confirmed by inspecting the layout tree — all columns end up CHUNKED, none DICT), costing 1.67x file size vs the Rust reference. Raising the budget on memory-rich hosts lets more columns keep their shared dictionary.
  • VortexWriter now reads the budget from WriteOptions instead of the constant; the test-only setDictRetainedBudgetForTest seam is removed in favor of configuring the budget through the real public API in tests.

Test plan

  • ./mvnw test -pl writer -am — 1709 tests, 0 failures
  • ./mvnw test-compile -pl calcite,integration,performance -am — all positional WriteOptions call sites updated, compiles clean
  • New WriteOptionsTest (4 tests) + rewritten GlobalDictUtf8Test demotion test using the real public API

🤖 Generated with Claude Code

The OOM fix that bounded VortexWriter's global-dictionary retained memory
hardcoded the aggregate budget at 256 MB (GLOBAL_DICT_MAX_RETAINED_BYTES).
Expose it via WriteOptions so callers can tune it per host/workload:

- WriteOptions gains a `globalDictMaxRetainedBytes` record component with a
  256 MB default in defaults()/cascading() and a withGlobalDictMaxRetainedBytes(long)
  copy-method matching the existing withXxx convention.
- VortexWriter reads the budget from its WriteOptions instead of the constant;
  the constant is deleted and its rationale moved onto the WriteOptions field.
- Removed the setDictRetainedBudgetForTest(long) test seam; the demotion test
  now configures the budget through the real public API
  (WriteOptions.cascading(3).withGlobalDictMaxRetainedBytes(120_000L)).
- Updated positional new WriteOptions(...) call sites for the new component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 force-pushed the feat/configurable-global-dict-budget branch from 2998c5b to 5dc0a7d Compare July 18, 2026 12:04
@dfa1
dfa1 merged commit 4cbc12d into main Jul 18, 2026
6 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