Expand description
N-dimensional Arrow arrays in Lance.
A table is a Lance dataset whose schema is the nd-arrow encoding: one
nd_arrow.array column per array name and an optional __global_attrs__
column. Each row is one NdRecordBatch,
a complete one or a chunk of a larger one.
open()andopen_with(): open a table and check its format version.StorageOptionshold the credentials of S3, Google Cloud Storage or Azure.write()andappend(): write a stream of nd record batches.NdWriter: write in several calls and commit once.scan(): read a stream of nd record batches, with a projection and filters.prune_filter()shows how a filter on values uses the stats.delete(),compact()andcleanup_old_versions(): delete rows and reclaim space.versions(),checkout()andrestore(): read and restore earlier versions.widen(): change the value type of a variable.ColumnOptions: Lance encoding options, like the compression, per column.encode_rows()andRowDecoder: the row encoding, for record batches that you write or read yourself.
See FORMAT.md for the table layout.
Re-exports§
pub use lance::deps::datafusion;
Structs§
- Cleanup
Stats - What a
cleanup_old_versionsremoved. - Column
Options - Lance encoding options of one column.
Noneleaves the choice to Lance. - Compact
Options - Options for
compact. - Compaction
Stats - What a
compactchanged. - NdScanner
- A scan that yields one nd record batch per row, in table order.
- NdWriter
- A writer that makes all its rows visible in one commit.
- RowDecoder
- Decodes the rows of one record batch of a table, one row at a time.
- Table
Version - One version of a table.
- Write
Options - Options for
write()andappend().
Enums§
- Byte
Stream Split - Byte stream split of floating point values before compression.
- Casting
- How a write treats a value or attribute type that differs from the table.
- Compression
- The general compression of the values of a column.
- Error
- Errors raised by lance-nd.
- Structural
Encoding - The page layout of a column.
- Write
Mode - How a write treats the table at its uri.
Constants§
- FORMAT_
VERSION - The format version that this release reads and writes.
- STATS_
PREFIX - The name prefix of the stats columns. Each variable name that starts with it is reserved.
Functions§
- append
- Append a stream of rows to the table of
datasetin one commit. Each nd record batch is one row. A failed row commits nothing. - check_
format - Fails when
datasetis not a lance-nd table ofFORMAT_VERSION. - checkout
- The table at
version, to read. A write to it fails, because it is not the latest version. - cleanup_
old_ versions - Remove the files of the table versions older than
older_than. The current version always stays. - column_
defaults - The column defaults of the table. New columns get them.
- compact
- Merge small fragments, split large fragments and remove deleted rows. Keeps the row order.
- delete
- Delete the rows that match
predicate, a Lance SQL filter. - delete_
expr - Delete the rows that match
expr, a DataFusion filter on the Lance table columns. - encode_
rows - Encode
rowsas one record batch, one row per nd record batch. - has_
stats truewhen the schema marks a table with stats.- open
- Open the lance-nd table at
uri. Fails when no table is there, or when the table has another format version. - open_
with - Open the lance-nd table at
uriwith Lance storage options, for example the credentials of an object store. Seecrate::StorageOptions. - prune_
filter - A filter for a scan of
tablewith the rows that can matchexpr.Nonemeans that every row is kept.crate::NdScanner::filter_expruses it. - restore
- Make the content of
versionthe latest version of the table, in a new commit. The versions after it stay in the history. - scan
- A scan over the rows of the table.
- set_
column_ defaults - Replace the column defaults of the table. Existing columns keep their encoding.
- stats_
column - The name of the stats column of
variable. - stats_
variable - The variable of the stats column
column, orNonefor another name. - variables
- The variables of the table, as logical fields typed by their values.
- versions
- The versions of the table that still have their files, oldest first.
- widen
- Change the value type of
variabletoto, for exampleFloat32toFloat64. The stats of the variable get the new type too. - write
- Write a stream of rows to the table at
uriin one commit. Each nd record batch is one row.
Type Aliases§
- Result
- A result with
Erroras the default error. - Storage
Options - Lance storage options, by key, for tables on object stores.