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 crc::FileSizeHistogram;pub use crc::FileStats;pub use utils::try_parse_uri;internal-apipub use utils::CollectInto;internal-apipub use utils::FoldWithOption;internal-apipub 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 plans::IoOperation;declarative-planspub use plans::Operation;declarative-planspub use plans::PlanBuilder;declarative-planspub use plans::PlanExecutor;declarative-planspub use plans::PlanResult;declarative-planspub use snapshot::Snapshot;pub use snapshot::SnapshotRef;pub use delta_kernel_derive;pub use arrow_59 as arrow;pub use parquet_59 as parquet;
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. - column_
trie internal-api - A trie (prefix tree) for efficient column path matching.
- 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). - crc
internal-api - CRC (version checksum) file support.
- engine
arrow-conversionordeclarative-plansordefault-engine-base - Engine infrastructure shared by
Engineimplementations. - 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. - last_
checkpoint_ hint internal-api - Utilities for reading the
_last_checkpointfile. Maybe this file should instead go under log_segment module since it should only really be used there? as hint for listing? - log_
replay internal-api - This module provides log replay utilities.
- log_
segment internal-api - Represents a segment of a delta log.
LogSegmentwraps a set of checkpoint and commit files. - log_
segment_ files internal-api LogSegmentFilesis a struct holding the result of listing the delta log. Currently, it exposes four APIs for listing:- metrics
- Metrics collection for Delta Kernel operations.
- object_
store arrow-59and (arrow-58orarrow-59) - parallel
internal-api - Two-phase log replay for parallel execution of checkpoint processing.
- partition
- Partition utilities for Delta table writes.
- path
internal-api - Utilities to make working with directory and file paths easier
- plans
declarative-plans - Declarative plans: the kernel describes data work as a relational plan; the engine executes it.
- reserved_
field_ ids - Reserved field IDs for metadata columns in Delta tables.
- row_
tracking test-utils - 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 ofTableConfiguration. 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.
- utils
internal-api - Various utility functions/macros used throughout the kernel
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.
- 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.
- Evaluation
Handler Extension internal-api - Internal trait to allow us to have a private
create_oneAPI that’s implemented for all EvaluationHandlers. - Expression
Evaluator - Trait for implementing an Expression evaluator.
- Into
Engine Data internal-api - A trait that allows converting a type into (single-row) EngineData
- 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