Repository navigation
feat!: report a load's committed rows to its caller after each commit - #407
Merged
Merged
Conversation
load_tables takes a committed-rows callback, called with the load's running total. BREAKING CHANGE: load_tables takes a fourth argument, committed: Option<CommittedRows>; pass None to keep the old behaviour.
A files merge loaded from 1,001 files hears each of its two commits, and its --reload, which merges into a build table, hears the total once at the swap. The committed-rows callback is documented as not panicking, and the load_tables doc names files folder swaps and child tables.
Deploying sqlload with
|
| Latest commit: |
bf81a93
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://13430de2.sqlload.pages.dev |
| Branch Preview URL: | https://wip-committed-rows.sqlload.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A program that embeds SQLLoad, such as SQLBuild, learns a load's rows only when
load_tablesreturns, so a long load shows no progress. The load event stream already reports rows, but only to the one listenerlisten()sets up for the command line, and it reports rows read rather than rows committed.Changes
load_tablestakes a fourth argument,committed: Option<CommittedRows>. PassNoneto keep the old behaviour.CommittedRows(sqlload::committed_rows::types) is called after each commit with the rows that load has committed so far, across all its tables and threads.load_tableskeeps its own total, so two loads running at once never see each other's rows. The total is added to and the callback called under one lock, so the totals a callback hears never go down.replace,recreate,--reloadrebuild or files folder swap reports its rows once, when it swaps in. Child (unnest) tables are not counted as the load's rows.listen(), the load event stream andLoadRunare unchanged.Verification
delete_inserthears 2, 3, then 5, and areplacehears 5 once, each ending at the rows its tables report. It fails if the per-commit report is removed.--reloadhears 1,001 once. It fails if the rebuild is reported per commit.cargo check, clippy andcargo fmtforsqlload(cli, duckdb), andfensu check. Clippy's newSome(x).filterlint and thefetch_updatedeprecation already fire in files this change doesn't touch.