Expand description
§Delta Kernel
Delta-kernel-rs is an experimental Delta implementation
focused on interoperability with a wide range of query engines. It supports table reads, table
creation, appends, file removals, deletion-vector updates, and limited schema evolution. This
library defines the traits that connectors implement to provide I/O and expression evaluation.
The delta_kernel_default_engine crate provides
a ready-to-use implementation based on Arrow, object_store, and Tokio.
A full rust example for reading table data using the default engine can be found in the
read-table-single-threaded example (and for a more complex multi-threaded reader see the
read-table-multi-threaded example). An example for reading the table changes for a table
using the default engine can be found in the read-table-changes example. The write-table
example demonstrates how to write data to a Delta table using the default engine.
§Engine trait
The Engine trait allows connectors to bring their own implementation of functionality such
as reading and writing Parquet and JSON files, listing files in storage, and evaluating
expressions. It exposes handler traits for each capability.
When adding cloud-storage functionality to an engine, such as writing JSON files, make sure to
test it against S3, Azure, and GCS.
§Expression handling
EvaluationHandler creates an ExpressionEvaluator for an Expression or a
PredicateEvaluator for a Predicate. Each evaluator can process multiple data batches.
§File system interactions
Delta Kernel needs to perform some basic operations against file systems like listing and
reading files. These interactions are encapsulated in the StorageHandler trait.
Implementers must take care that all assumptions on the behavior of the functions - like sorted
results - are respected.
§Reading log and data files
Delta Kernel requires the capability to read and write JSON and Parquet files, exposed via the
JsonHandler and ParquetHandler respectively. Their read methods receive the context
needed to execute the operation.
Re-exports§
pub use cancellation::CancellationToken;pub use cancellation::CancellationTokenRef;pub use cancellation::CancelledFuture;pub use engine_data::EngineData;pub use engine_data::FilteredEngineData;pub use engine_data::FilteredRowVisitor;pub use engine_data::GetData;pub use engine_data::RowIndexIterator;pub use engine_data::RowVisitor;pub use error::DeltaResult;pub use error::DeltaResultIterator;pub use error::DeltaResultIteratorStatic;pub use error::Error;pub use expressions::Expression;pub use expressions::ExpressionRef;pub use expressions::Predicate;pub use expressions::PredicateRef;pub use snapshot::Snapshot;pub use snapshot::SnapshotRef;pub use delta_kernel_derive;
Modules§
- actions
- Provides parsing and manipulation of the various actions defined in the Delta specification
- cancellation
- Cooperative cancellation for long-running Kernel reads.
- checkpoint
- This module implements the API for customized Delta checkpoint writes, where the
caller drives the write themselves. The entry point is
Snapshot::create_checkpoint_writer. - commit_
range - Read a contiguous range of raw Delta commits.
- committer
- The
committermodule provides aCommittertrait which allows different implementations to define how to commit transactions to a catalog or filesystem. For catalog-managed tables, aCommitterspecific to the managing catalog should be provided. For non-catalog-managed tables, theFileSystemCommittershould be used to commit directly to the object store (via put-if-absent call to storage to atomically write new commit files). - engine_
data - Traits that engines need to implement in order to pass data between themselves and kernel.
- error
- Definitions of errors that the delta kernel can encounter
- expressions
- Definitions and functions to create and manipulate kernel expressions
- history_
manager - This module provides functions for performing timestamp queries over the Delta Log, translating between timestamps and Delta versions.
- incremental_
scan - Streams the file-action diff between two table versions. See
IncrementalScanBuilderfor the entry point. - kernel_
predicates - Support for kernel-driven predicate evaluation via the
KernelPredicateEvaluatortrait. Various trait implementations are used for partition pruning, stats-based data skipping, and parquet row group filtering. The evaluation is normally performed overScalarvalues, but data skipping “evaluation” actually produces a transformed predicate that replaces column references with stats column references, which log replay will instruct the engine to evaluate. - metrics
- Metrics collection for Delta Kernel operations.
- partition
- Partition utilities for Delta table writes.
- reserved_
field_ ids - Reserved field IDs for metadata columns in Delta tables.
- scan
- Functionality to create and execute scans (reads) over data stored in a delta table
- schema
- Definitions and functions to create and manipulate kernel schema
- snapshot
- In-memory representation of snapshots of tables (snapshot is a table at given point in time, it has schema etc.)
- struct_
patch - Struct patches: sparse,
O(changes)edits to the fields of an input struct. - table_
changes - Reads a table’s change data feed between two versions.
- table_
configuration - This module defines [
TableConfiguration], a high level api to check feature support and feature enablement for a table at a given version. This encapsulatesProtocol,Metadata,Schema,TableProperties, andColumnMappingMode. These structs in isolation should be considered raw and unvalidated if they are not a part of [TableConfiguration]. We unify these fields because they are deeply intertwined when dealing with table features. For example: To check that deletion vector writes are enabled, you must check both both the protocol’s reader/writer features, and ensure that the deletion vector table property is enabled in theTableProperties. - table_
features - table_
properties - Delta Table properties. Note this module implements per-table configuration which governs how table-level capabilities/properties are configured (turned on/off etc.). This is orthogonal to protocol-level ‘table features’ which enable or disable reader/writer features (which then usually must be enabled/configured by table properties).
- transaction
- transforms
- Shared transform infrastructure.
Macros§
- transform_
output_ type - Defines a transform’s
OutputandResidualassociated types.
Structs§
- Action
Reconciliation Iterator - Iterator over action reconciliation data.
- Action
Reconciliation Iterator State - Stats for ActionReconciliationIterator
- File
Meta - The metadata that describes an object.
- File
Size Histogram - Tracks the distribution of file sizes across predefined bins.
- File
Stats - File-level statistics for a table version: total file count, size, and histogram.
- LogCompaction
Writer - Writer for log compaction files
- LogPath
- A path to a valid delta log file. You can parse a given
FileMetainto aLogPathusingLogPath::try_new. - Parquet
Footer - Metadata from a Parquet file footer.
Traits§
- AsAny
- Extension trait that makes it easier to work with traits objects that implement
Any, implemented automatically for any type that satisfiesAny,Send, andSync. In particular, given sometrait T: Any + Send + Sync, it allows upcastingTtodyn Any + Send + Sync, which in turn allows downcasting the result to a concrete type. - DynPartial
Eq - Extension trait that facilitates object-safe implementations of
PartialEq. - Engine
- The
Enginetrait encapsulates the functionality an engine or connector provides to operate on Delta tables. - Evaluation
Handler - Provides expression evaluation capability to Delta Kernel.
- Expression
Evaluator - Trait for implementing an Expression evaluator.
- Json
Handler - Provides JSON handling functionality to Delta Kernel.
- Parquet
Handler - Provides Parquet file related functionalities to Delta Kernel.
- Predicate
Evaluator - Trait for implementing a Predicate evaluator.
- Storage
Handler - Provides file system related functionalities to Delta Kernel.
Functions§
- should_
compact - Determine if log compaction should be performed based on the commit version and compaction interval.
Type Aliases§
- File
Data Read Result - Data read from a Delta table file and the corresponding scan file information.
- File
Data Read Result Iterator - An iterator of data read from specified files
- File
Index - File
Size - File
Slice - A specification for a range of bytes to read from a file location
- Version
- Delta table version is 8 byte unsigned int