Skip to content

Load Dataset as Array

Loads a small rows/table/dataset handle as a capped array.

@lainstack/collection/load-array · Data

Load Dataset as Array copies a Table or dataset handle into an inline list under items, so that a later @lainstack/js/transform or other block can read all rows at once. summary.rowCount and summary.byteCount report what was loaded.

Choose it only for small datasets that one block must see as a whole. To act on each row separately, use @lainstack/flow/for-each-item, which handles large datasets. Handles come from blocks such as @lainstack/csv/parse, @lainstack/reference-table/read and @lainstack/document/extract-text.

Traps:

  • It never truncates. When the dataset is over a cap, the step fails and loads nothing. The defaults are 1,000 rows and 1,048,576 bytes. The hard maximums are 10,000 rows and 10 MiB. Raise maxRows or maxBytes only as far as the data needs.
  • The byte cap counts each row as serialized JSON, not the stored file size.
  • A job-backed dataset that did not finish successfully fails. You do not get partial rows.
  • A dataset with no rows gives an empty list.
Setting Key Type Details
Max rows (required) maxRows Number Hard row cap for materialization. Use For each item for larger datasets.
Max bytes (required) maxBytes Number Hard byte cap for materialization. Use row-by-row processing for larger datasets.
Output Path Type
Row count summary.rowCount Number
Byte count summary.byteCount Number