mirror of
https://github.com/lancedb/lancedb.git
synced 2026-09-01 19:18:38 +00:00
d118ef168b
A view definition recorded its source by bare name and refresh resolved that name at the root, so declaring a view over a namespaced source was refused outright -- materialized views were root-only for every caller. The definition now carries `source_namespace`, and refresh opens the source at that coordinate. `plan` takes the namespace too: refresh re-plans the stored definition and persists the result when it migrates, so defaulting it there would strand the view on its next rebuild. The stored kind is the version boundary. Root definitions keep the `select` form byte-for-byte, so everything written before this change reads exactly as it always did. A namespaced source is stored as `namespaced_select`: released readers drop unknown fields and resolve a `select` source at the root, so keeping the old kind would let a rolled-back worker refresh a view from a same-name root table -- the new kind routes them to their existing unrecognized-kind refusal instead. The Python and Node definition parsers learn the new kind alongside the Rust core.
891 B
891 B
@lancedb/lancedb • Docs
@lancedb/lancedb / MaterializedViewDefinition
Interface: MaterializedViewDefinition
The query that defines a materialized view.
Properties
filter?
optional filter: string;
SQL predicate selecting the source rows the view holds.
inputs
inputs: string[];
Source columns the projections and filter read.
limit?
optional limit: number;
Cap on the number of rows the view holds.
projections
projections: [string, string][];
[output column, SQL expression] pairs, in view schema order.
sourceNamespace
sourceNamespace: string[];
Namespace holding the source table; empty is the root namespace.
sourceTable
sourceTable: string;
Name of the source table, in the same database as the view.