v2026.11.2
All Bundles
Bundle

In-memory query engine over typed columns. Tables are filled row by row or loaded from sources (CSV files, folders, the program's own objects) and queried with SQL-like statements; aggregates, Describe() and Finder (file search) are included. Compile with -lib query.

JsonLinesSource

A JSON Lines file (one JSON object per line, '.jsonl' or '.ndjson') as a table. Nested objects become dotted column names ('address.city'), and each nested array becomes a child table, as JsonSource makes them: an array member 'tags' of table 'runs' is the table 'runs_tags', joined back through '_parent_id' = '_id'. Columns are typed by all their values: whole numbers INT, any decimal FLOAT, true and false BOOL, and any mix, or text, STRING. null and a missing key are empty cells. A line that is not a JSON object is an error naming the line. Columns appear in the order keys are first seen, alphabetical within an object. A name ending in '.gz' is decompressed first.

Implements: Source

Example

runs := JsonLinesSource->New("eval.jsonl")->Read();
runs->Describe()->ToString()->PrintLine();

Operations

FromText # function

Makes a source over JSON Lines text already in memory

function : FromText(name:String, text:String) ~ JsonLinesSource

Parameters

NameTypeDescription
nameStringtable name
textStringJSON Lines text

Return

TypeDescription
JsonLinesSourcesource

GetChildTables #

Gets the child tables the last Read made, in the order their arrays were first seen

method : public : GetChildTables() ~ Vector<Table>

Return

TypeDescription
Vector<Table>child tables, empty if there are none

GetError #

Gets the reason the last read failed

method : public : GetError() ~ String

Return

TypeDescription
Stringerror, Nil if none

GetTables #

Gets the tables the file provides, the main table first; they are known only after reading it

method : public : GetTables() ~ TableSpec[]

Return

TypeDescription
TableSpectable shapes

Load #

Loads the file's tables into a catalog

method : public : Load(catalog:Catalog, hint:ScanHint) ~ Bool

Parameters

NameTypeDescription
catalogCatalogcatalog
hintScanHintcolumns and rows of the main table needed, Nil for everything

Return

TypeDescription
Booltrue if loaded

New # constructor

Constructor; the table is named after the file

New(path:String)

Parameters

NameTypeDescription
pathStringJSON Lines file

New # constructor

Constructor

New(path:String, name:String)

Parameters

NameTypeDescription
pathStringJSON Lines file
nameStringtable name

Read #

Reads the file as a table

method : public : Read() ~ Table

Return

TypeDescription
Tabletable, Nil on error (see GetError)

Read #

Reads the file as a table

method : public : Read(hint:ScanHint) ~ Table

Parameters

NameTypeDescription
hintScanHintcolumns and rows needed, Nil for everything

Return

TypeDescription
Tabletable, Nil on error (see GetError)