Skip to content

feat(duckdbservice): set late_materialization_max_rows=6000 on all workers - #1018

Merged
fuziontech merged 1 commit into
mainfrom
worker-late-materialization-max-rows
Jul 30, 2026
Merged

feat(duckdbservice): set late_materialization_max_rows=6000 on all workers#1018
fuziontech merged 1 commit into
mainfrom
worker-late-materialization-max-rows

Conversation

@fuziontech

Copy link
Copy Markdown
Member

What

Sets late_materialization_max_rows = 6000 on every DuckDB worker, applied in OpenDuckDBPair (the worker-process DB factory in duckdbservice/duckdb_pair.go), so it covers all workers regardless of how they were spawned (local process pools and K8s pods both go through this path).

Why SET GLOBAL

late_materialization_max_rows is session-scoped (LOCAL) in DuckDB 1.5.x — verified against the bundled bindings:

  • plain SET on the warmup connection: fresh connection on the same connector still sees the default (50)
  • SET GLOBAL: fresh connection sees the new value
  • duckdb_settings() reports scope = LOCAL

So a one-time SET GLOBAL at open is what propagates the cap to every session-pool connection serving user queries. Users can still override it per session if needed.

Test

TestOpenDuckDBPairSetsLateMaterializationMaxRows (TDD: failed with 50 before the change, passes after) opens a real worker pair and asserts the value from a fresh connector connection — the same shape as a session-pool connection — so it also guards the SET GLOBAL scope assumption.

Verification

  • go test ./duckdbservice/ — pass
  • go vet, gofmt — clean
  • just lint could not run locally (golangci-lint not installed); relies on CI

…rkers

Apply SET GLOBAL late_materialization_max_rows = 6000 when a worker opens
its DuckDB pair. The setting is session-scoped (LOCAL) in DuckDB, so SET
GLOBAL is required for the value to reach every session connection on the
shared connector; a plain SET would only affect the warmup connection.
@github-actions

Copy link
Copy Markdown

Test Impact Plan

Deterministic summary of how this PR changes tests, CI runners, and coverage-risk signals.

Summary

Area Added Changed Deleted
Test files 1 0 0
E2E/journey files 0 0 0
Workflow files 0 0 0

Signals

  • Test cases: +1 / -0
  • Assertions: +3 / -0
  • Skips or known failures added: 0
  • Workflow continue-on-error added: 0
  • Workflow path filters added: 0
  • Test commands removed from justfile: 0
  • E2E/journey retry lines added: 0

Coverage risk: neutral or increased

No coverage-reduction warnings detected.

@fuziontech
fuziontech merged commit 79b3877 into main Jul 30, 2026
31 checks passed
@fuziontech
fuziontech deleted the worker-late-materialization-max-rows branch July 30, 2026 15:17
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