Skip to content

feat: report the rows a load committed before it failed - #1985

Queued
kvlonge wants to merge 10 commits into
mainfrom
feat/load-committed-rows
Queued

kvlonge wants to merge 10 commits into
mainfrom
feat/load-committed-rows

Conversation

@kvlonge

@kvlonge kvlonge commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Why

A load reported its rows only once it finished, so a load that raised after committing rows reported none, and the live build view showed nothing while a long load ran.

Changes

  • Pin SQLLoad 0.92.0. run_sqlload_project and run_sqlload_loader take an on_rows callback that SQLLoad calls with the committed total after each commit. The load runs with the GIL released, and the GIL is held only for the callback. run_sqlload_project takes its plan as one plan=(selected, required, reload) tuple.
  • Load nodes and @loader sources report those totals through the build's on_rows_written, so progress shows rows as they land.
  • The build scheduler keeps the last total each node reported. When a node's own work raises, the node boundary puts that total on the node's failed result as rows_affected. None means the node reported no count. Any node that reports rows gets this; the boundary has no load-specific branch.
  • The build node result union has one name, BuildNodeResult (refactor only).
  • windows-sys 0.59 (from SQLLoad on Windows) gets the same features in the extension and CLI builds.

Not covered here:

  • A @loader source whose own handler catches the error still reports no count.
  • A node failed by the scheduler itself, such as at the time limit, records no count, as before.

DuckShop: no new edge case. The behavior needs a load that raises after a commit, which a project shape can't produce. The integration test injects that failure instead.

Verification

  • Integration: a load that raises after two files commit records rows_loaded 2; one that raises with nothing committed records null. With the boundary's rows removed, the first case fails.
  • Load-session tests: committed totals reach the callback, including from several threads during one load, and never go down.
  • Build node-error, load and build unit tests pass (123).
  • fensu 0 faults, dupes no new clusters, ruff, ty, make check-ci.

BREAKING CHANGE: an error inside a node no longer stops the build; that node fails and the rest of the build runs.
…d-committed-rows

# Conflicts:
#	src/sqlbuild/executor/build/_helpers/load_node.py
# Conflicts:
#	src/sqlbuild/executor/build/_helpers/load_node.py
#	src/sqlbuild/executor/build/_helpers/node_errors.py
#	src/sqlbuild/executor/build/classes/build_scheduler.py
…LI builds

SQLLoad 0.92.0 brings in windows-sys 0.59 on Windows, where the extension
enables its debug and diagnostics features and the CLI does not.
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Dec 6, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 6, 2026
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Dec 6, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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