Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions changelog.d/ITL-1776.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
it keeps. Every tag column, every key column and the columns of a `where`
condition are still read. The result, its hashes, schema, record ids and stored
paths are those of the whole read followed by the selection. On a table with a
wide column the read is several times faster. A job still reads each SpiralDB
source whole.
wide column the read is several times faster.
21 changes: 21 additions & 0 deletions changelog.d/ITL-1798.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Changed

- In a pipeline job, a `SpiralDBTableSource` node read only by column selections
(`select_data_columns` or `select_columns` directly on the source, including the
automatic selection before a function pod) now scans only the columns those
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
selections keep: the union, when several selections read it. Every tag column, every
key column and the columns of a `where` condition are still read. This holds for
`job.run()`, `job.run_async()`, load-only runs and a node's own `run()`; on
`job.run_async()` the narrowed rows are read and sent batch by batch, as a whole
read's are, so the first row reaches the next step before the scan ends and one
batch is held at a time. Any other
step directly on the source (a drop, a join, a function pod taking every column)
means the whole table is read, as before. The job's rows, stored rows, hashes,
schemas, record ids and stored paths are those of the whole read, and an
orchestrator's collected output for the source node (`node_outputs`) is the whole
node's. Reading that collected output whole (its table, its rows, or any column the
selections left out) reads the source again, whole, on first use, and so transfers
the columns the selections omit; that read is of the version the run used, as
before, also after a later check or run has pinned a newer one. Describing the
collected output (its keys, schemas, hashes, `explain()`, a `head(0)` that asks for no row hash) reads nothing,
and a step built on it reads only when its own rows are read. On a table with a wide column, a narrow job is several times faster.
17 changes: 15 additions & 2 deletions docs/concepts/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,21 @@ selection a function pod adds before itself for columns it does not take) asks S
the columns it keeps, so a wide column it drops (images, long arrays) is never transferred.
Every tag column, every key column and the columns of a `where` condition are still read.
This is only how the rows are read: the result, its hashes, schema and record ids are those
of the whole read followed by the selection. For now it applies to a stream read outside a
job; a pipeline job reads each SpiralDB source whole.
of the whole read followed by the selection. In a pipeline job, a source node reads only
the columns its steps keep when every step that reads it directly is a `select_data_columns`
or `select_columns` (several such steps read the union of their columns); any other step on
the source (a drop, a join, a function pod given the source's every column) means the whole
table is read. With `run_async()`, the narrowed rows are read and sent batch by batch, as a
whole read's are: the first row reaches the next step before the scan ends, and one batch
is held at a time. The job's rows, stored rows, hashes and stored paths are the same either way.
The source node's own output, as an orchestrator collects it (`node_outputs`), still stands
for every column: reading it whole (its `as_table()`, its rows, or any read that needs the
columns the selections left out) reads the source again, whole, the first time, and so
transfers those columns after all. That read is of the version the run used, also after
a later check or run has pinned a newer version, so it gives the rows a whole read gave
when the run made the output. Describing that output reads nothing: its keys, schemas,
hashes, `explain()` and a `head(0)` that asks for no row hash, and a step built on it reads only when its own rows
are read.

**The row cap.** One read returns at most `max_rows` rows (default 100,000). A read that
would return more raises `SourceTooLargeError`, which says so and gives the ways out:
Expand Down
Loading
Loading